From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7015D446AC; Mon, 1 Apr 2024 16:21:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711988512; cv=none; b=ZRNEo5+LS1BvvOuzoZhZPX8o/xX7f3JFQLyN/dcsbIKtIIOaAfT9hzoWR6BBd0QSwp9vBm86YWuJE9WC8iX+vV917NXONVJLqlKb/4VwE5YMmel9gwLEiMb3lHjaYO8nHMtDri3kAkxn7t6if7Ax20SnD2xn1vIKj2DtiutQE00= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711988512; c=relaxed/simple; bh=9jqZ2k0fL1UKgwwaqczpBetiuJ0XnxaQeDdslulflxU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KDo/B8aelcHd98id8HBintkN5TDZKhzfwWcWU30KIKvyZpyUUAeDgidUWGE5wztyNzPYv1p68kIugrH1kV9OkNburP4Bsxdgbw97FWWETzmEvFHwoqS5zfTnSEEds7vZuWef4ljypTZ437D2aXoIgu/5jO675Ey59RI/Yz1FFYk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BvYJ4q/f; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BvYJ4q/f" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9C75C433C7; Mon, 1 Apr 2024 16:21:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711988512; bh=9jqZ2k0fL1UKgwwaqczpBetiuJ0XnxaQeDdslulflxU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BvYJ4q/fGdUQfurhZ4djEahYze+15DQ++meDZqoo0eigUeBll65ggMkcBZy+pQN8K Ofv7tb6/JK8eSamuom74bsRIp4iFNTaqtGhT0RcleagtnoRgylx2FCwN9b5od9Rsa/ un/JpBc+Dy7l4prGtCSqKc0AsYLKpsZ0E8zly3Yg= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Mario Limonciello , Alex Deucher , Chaitanya Dhere , Alex Hung , Swapnil Patel , Daniel Wheeler , Sasha Levin Subject: [PATCH 6.7 207/432] drm/amd/display: Change default size for dummy plane in DML2 Date: Mon, 1 Apr 2024 17:43:14 +0200 Message-ID: <20240401152559.308284066@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240401152553.125349965@linuxfoundation.org> References: <20240401152553.125349965@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.7-stable review patch. If anyone has any objections, please let me know. ------------------ From: Swapnil Patel [ Upstream commit 75eb8f7df65c5e6eb22a5aff8deb60ce0b65de1a ] [WHY & HOW] Currently, to map dc states into dml_display_cfg, We create a dummy plane if the stream doesn't have any planes attached to it. This dummy plane uses max addersable width height. This results in certain mode validations failing when they shouldn't. Cc: Mario Limonciello Cc: Alex Deucher Cc: stable@vger.kernel.org Reviewed-by: Chaitanya Dhere Acked-by: Alex Hung Signed-off-by: Swapnil Patel Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- .../display/dc/dml2/dml2_translation_helper.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c index 16452dae4acac..5ef8c2e255808 100644 --- a/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +++ b/drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c @@ -824,13 +824,25 @@ static struct scaler_data get_scaler_data_for_plane(const struct dc_plane_state static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsigned int location, const struct dc_stream_state *in) { + dml_uint_t width, height; + + if (in->timing.h_addressable > 3840) + width = 3840; + else + width = in->timing.h_addressable; // 4K max + + if (in->timing.v_addressable > 2160) + height = 2160; + else + height = in->timing.v_addressable; // 4K max + out->CursorBPP[location] = dml_cur_32bit; out->CursorWidth[location] = 256; out->GPUVMMinPageSizeKBytes[location] = 256; - out->ViewportWidth[location] = in->timing.h_addressable; - out->ViewportHeight[location] = in->timing.v_addressable; + out->ViewportWidth[location] = width; + out->ViewportHeight[location] = height; out->ViewportStationary[location] = false; out->ViewportWidthChroma[location] = 0; out->ViewportHeightChroma[location] = 0; @@ -849,7 +861,7 @@ static void populate_dummy_dml_plane_cfg(struct dml_plane_cfg_st *out, unsigned out->HTapsChroma[location] = 0; out->VTapsChroma[location] = 0; out->SourceScan[location] = dml_rotation_0; - out->ScalerRecoutWidth[location] = in->timing.h_addressable; + out->ScalerRecoutWidth[location] = width; out->LBBitPerPixel[location] = 57; -- 2.43.0