amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
To: amd-gfx@lists.freedesktop.org
Cc: Jun Lei <Jun.Lei@amd.com>, Samson Tam <Samson.Tam@amd.com>
Subject: [PATCH 08/30] drm/amd/display: Fix stereo with DCC enabled
Date: Mon, 11 Nov 2019 19:33:02 -0500	[thread overview]
Message-ID: <20191112003324.8419-9-Rodrigo.Siqueira@amd.com> (raw)
Message-ID: <20191112003302.TJ5BJMaukp0twRsDBXD-ypIe_r8BhcmXsontDX77lqY@z> (raw)
In-Reply-To: <20191112003324.8419-1-Rodrigo.Siqueira@amd.com>

From: Samson Tam <Samson.Tam@amd.com>

[Why]
When sending DCC with Stereo, DCC gets enabled but the meta addresses
are 0. This happens momentarily before the meta addresses are populated
with a valid address.

[How]
Add call validate_dcc_with_meta_address() in
copy_surface_update_to_plane() to check for surface address and DCC
change.
When DCC has changed, check if DCC enable is true but meta address is 0.
If so, we turn DCC enable to false. When surface address has changed, we
check if DCC enable is false but meta address is not 0. If so, we turn
DCC enable back to true.  This will restore DCC enable to the proper
setting once the meta address is valid.

Signed-off-by: Samson Tam <Samson.Tam@amd.com>
Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c | 27 ++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 1fdba13b3d0f..ffc8b1f89690 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -1748,12 +1748,37 @@ static struct dc_stream_status *stream_get_status(
 
 static const enum surface_update_type update_surface_trace_level = UPDATE_TYPE_FULL;
 
+static void validate_dcc_with_meta_address(
+	struct dc_plane_dcc_param *dcc,
+	struct dc_plane_address *address)
+{
+	if ((address->grph.meta_addr.quad_part == 0) &&
+		dcc->enable) {
+		ASSERT(!dcc->enable);
+		dcc->enable = false;
+	} else if ((address->grph.meta_addr.quad_part != 0) &&
+		!dcc->enable)
+		dcc->enable = true;
+
+	if (address->type != PLN_ADDR_TYPE_GRAPHICS) {
+		if ((address->grph_stereo.right_meta_addr.quad_part == 0) &&
+			dcc->enable) {
+			ASSERT(!dcc->enable);
+			dcc->enable = false;
+		} else if ((address->grph_stereo.right_meta_addr.quad_part != 0) &&
+			!dcc->enable)
+			dcc->enable = true;
+	}
+}
+
 static void copy_surface_update_to_plane(
 		struct dc_plane_state *surface,
 		struct dc_surface_update *srf_update)
 {
 	if (srf_update->flip_addr) {
 		surface->address = srf_update->flip_addr->address;
+		validate_dcc_with_meta_address(&surface->dcc, &surface->address);
+
 		surface->flip_immediate =
 			srf_update->flip_addr->flip_immediate;
 		surface->time.time_elapsed_in_us[surface->time.index] =
@@ -1802,6 +1827,8 @@ static void copy_surface_update_to_plane(
 				srf_update->plane_info->global_alpha_value;
 		surface->dcc =
 				srf_update->plane_info->dcc;
+		validate_dcc_with_meta_address(&surface->dcc, &surface->address);
+
 		surface->sdr_white_level =
 				srf_update->plane_info->sdr_white_level;
 		surface->layer_index =
-- 
2.24.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2019-11-12  0:33 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12  0:32 [PATCH 00/30] DC Patches 11 Nov 2019 Rodrigo Siqueira
2019-11-12  0:32 ` Rodrigo Siqueira
     [not found] ` <20191112003324.8419-1-Rodrigo.Siqueira-5C7GfCeVMHo@public.gmane.org>
2019-11-12  0:32   ` [PATCH 01/30] drm/amd/display: add automated audio test support Rodrigo Siqueira
2019-11-12  0:32     ` Rodrigo Siqueira
2019-11-12  0:32   ` [PATCH 02/30] drm/amd/display: Renoir chroma viewport WA change formula Rodrigo Siqueira
2019-11-12  0:32     ` Rodrigo Siqueira
2019-11-12  0:32   ` [PATCH 03/30] drm/amd/display: Renoir chroma viewport WA Read the correct register Rodrigo Siqueira
2019-11-12  0:32     ` Rodrigo Siqueira
2019-11-12  0:32   ` [PATCH 04/30] drm/amd/display: Add hubp clock status in DTN log for Navi Rodrigo Siqueira
2019-11-12  0:32     ` Rodrigo Siqueira
2019-11-12  0:32   ` [PATCH 05/30] drm/amd/display: Update background color in bottommost mpcc Rodrigo Siqueira
2019-11-12  0:32     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 06/30] drm/amd/display: Fix incorrect deep color setting in YCBCR420 modes Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 07/30] drm/amd/display: 3.2.59 Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` Rodrigo Siqueira [this message]
2019-11-12  0:33     ` [PATCH 08/30] drm/amd/display: Fix stereo with DCC enabled Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 09/30] drm/amd/display: Changes in dc to allow full update in some cases Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 10/30] drm/amd/display: Add DMUB service function check if hw initialized Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 11/30] drm/amd/display: Add DMUB param to load inst const from driver Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 12/30] drm/amd/display: Add debugfs initalization on mst connectors Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 13/30] drm/amd/display: Connect DIG FE to its BE before link training starts Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 14/30] drm/amd/display: Clean up some code with unused registers Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 15/30] drm/amd/display: revert change causing DTN hang for RV Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 16/30] drm/amd/display: Fix debugfs on MST connectors Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 17/30] drm/amd/display: cleanup of construct and destruct funcs Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 18/30] drm/amd/display: add color space option when sending link test pattern Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 19/30] drm/amd/display: Adjust DML workaround threshold Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 20/30] drm/amd/display: Add debug trace for dmcub FW autoload Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 21/30] drm/amd/display: 3.2.60 Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 22/30] drm/amd/display: add debugfs sdp hook up function for Navi Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 23/30] drm/amd/display: Avoid conflict between HDR multiplier and 3dlut Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 24/30] drm/amd/display: Don't spin forever waiting for DMCUB phy/auto init Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 25/30] drm/amd/display: cleanup of function pointer tables Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 26/30] drm/amd/display: DML Validation Dump/Check with Logging Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 27/30] drm/amd/display: Spin for DMCUB PHY init in DC Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 28/30] drm/amd/display: Use a temporary copy of the current state when updating DSC config Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 29/30] drm/amd/display: Add DSC 422Native debug option Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira
2019-11-12  0:33   ` [PATCH 30/30] drm/amd/display: Add Navi10 DMUB VBIOS code Rodrigo Siqueira
2019-11-12  0:33     ` Rodrigo Siqueira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191112003324.8419-9-Rodrigo.Siqueira@amd.com \
    --to=rodrigo.siqueira@amd.com \
    --cc=Jun.Lei@amd.com \
    --cc=Samson.Tam@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).