All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: stylon.wang@amd.com, Aric Cyr <Aric.Cyr@amd.com>,
	Jun Lei <Jun.Lei@amd.com>,
	solomon.chiu@amd.com, Sunpeng.Li@amd.com, Harry.Wentland@amd.com,
	qingqing.zhuo@amd.com, Rodrigo.Siqueira@amd.com,
	roman.li@amd.com, Anson.Jacob@amd.com, Aurabindo.Pillai@amd.com,
	Jimmy Kizito <Jimmy.Kizito@amd.com>,
	wayne.lin@amd.com, mikita.lipski@amd.com,
	Bhawanpreet.Lakha@amd.com, agustin.gutierrez@amd.com,
	pavle.kotarac@amd.com
Subject: [PATCH 08/16] drm/amd/display: Add work around for tunneled MST.
Date: Fri, 26 Nov 2021 14:49:14 -0500	[thread overview]
Message-ID: <20211126194922.816835-9-Bhawanpreet.Lakha@amd.com> (raw)
In-Reply-To: <20211126194922.816835-1-Bhawanpreet.Lakha@amd.com>

From: Jimmy Kizito <Jimmy.Kizito@amd.com>

[Why]
Certain USB4 docks do not seem to be able to handle disabling
DSC once it has been enabled on an MST stream. This can result
in blank displays.

[How]
As a work around, always enable DSC on docks exhibiting this issue. The
flag to indicate the use of DSC for MST streams on a USB4 dock is set
during detection of the dock and only cleared when the USB4 dock is
disconnected.

Reviewed-by: Jun Lei <Jun.Lei@amd.com>
Reviewed-by: Aric Cyr <Aric.Cyr@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Jimmy Kizito <Jimmy.Kizito@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 16 +++++++++++++++
 .../gpu/drm/amd/display/dc/core/dc_resource.c | 20 +++++++++----------
 drivers/gpu/drm/amd/display/dc/dc.h           |  3 ++-
 drivers/gpu/drm/amd/display/dc/dc_link.h      |  2 ++
 4 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 3d08f8eba402..faa0bc308fc8 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -758,6 +758,18 @@ static bool detect_dp(struct dc_link *link,
 			dal_ddc_service_set_transaction_type(link->ddc,
 							     sink_caps->transaction_type);
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
+			/* Apply work around for tunneled MST on certain USB4 docks. Always use DSC if dock
+			 * reports DSC support.
+			 */
+			if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA &&
+					link->type == dc_connection_mst_branch &&
+					link->dpcd_caps.branch_dev_id == DP_BRANCH_DEVICE_ID_90CC24 &&
+					link->dpcd_caps.dsc_caps.dsc_basic_caps.fields.dsc_support.DSC_SUPPORT &&
+					!link->dc->debug.dpia_debug.bits.disable_mst_dsc_work_around)
+				link->wa_flags.dpia_mst_dsc_always_on = true;
+#endif
+
 #if defined(CONFIG_DRM_AMD_DC_HDCP)
 			/* In case of fallback to SST when topology discovery below fails
 			 * HDCP caps will be querried again later by the upper layer (caller
@@ -1203,6 +1215,10 @@ static bool dc_link_detect_helper(struct dc_link *link,
 			LINK_INFO("link=%d, mst branch is now Disconnected\n",
 				  link->link_index);
 
+			/* Disable work around which keeps DSC on for tunneled MST on certain USB4 docks. */
+			if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA)
+				link->wa_flags.dpia_mst_dsc_always_on = false;
+
 			dm_helpers_dp_mst_stop_top_mgr(link->ctx, link);
 
 			link->mst_stream_alloc_table.stream_count = 0;
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index a2cf35a7ccaa..0da692c9a543 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -2258,16 +2258,6 @@ enum dc_status dc_validate_global_state(
 
 	if (!new_ctx)
 		return DC_ERROR_UNEXPECTED;
-#if defined(CONFIG_DRM_AMD_DC_DCN)
-
-	/*
-	 * Update link encoder to stream assignment.
-	 * TODO: Split out reason allocation from validation.
-	 */
-	if (dc->res_pool->funcs->link_encs_assign && fast_validate == false)
-		dc->res_pool->funcs->link_encs_assign(
-			dc, new_ctx, new_ctx->streams, new_ctx->stream_count);
-#endif
 
 	if (dc->res_pool->funcs->validate_global) {
 		result = dc->res_pool->funcs->validate_global(dc, new_ctx);
@@ -2319,6 +2309,16 @@ enum dc_status dc_validate_global_state(
 		if (!dc->res_pool->funcs->validate_bandwidth(dc, new_ctx, fast_validate))
 			result = DC_FAIL_BANDWIDTH_VALIDATE;
 
+#if defined(CONFIG_DRM_AMD_DC_DCN)
+	/*
+	 * Only update link encoder to stream assignment after bandwidth validation passed.
+	 * TODO: Split out assignment and validation.
+	 */
+	if (result == DC_OK && dc->res_pool->funcs->link_encs_assign && fast_validate == false)
+		dc->res_pool->funcs->link_encs_assign(
+			dc, new_ctx, new_ctx->streams, new_ctx->stream_count);
+#endif
+
 	return result;
 }
 
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 90baef199c12..1738556c9b59 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -510,7 +510,8 @@ union dpia_debug_options {
 		uint32_t disable_dpia:1;
 		uint32_t force_non_lttpr:1;
 		uint32_t extend_aux_rd_interval:1;
-		uint32_t reserved:29;
+		uint32_t disable_mst_dsc_work_around:1;
+		uint32_t reserved:28;
 	} bits;
 	uint32_t raw;
 };
diff --git a/drivers/gpu/drm/amd/display/dc/dc_link.h b/drivers/gpu/drm/amd/display/dc/dc_link.h
index d449e72a4e2a..30822aa33931 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_link.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_link.h
@@ -192,6 +192,8 @@ struct dc_link {
 		bool dp_skip_DID2;
 		bool dp_skip_reset_segment;
 		bool dp_mot_reset_segment;
+		/* Some USB4 docks do not handle turning off MST DSC once it has been enabled. */
+		bool dpia_mst_dsc_always_on;
 	} wa_flags;
 	struct link_mst_stream_allocation_table mst_stream_alloc_table;
 
-- 
2.25.1


  parent reply	other threads:[~2021-11-26 19:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-26 19:49 [PATCH 00/16] DC Patches Nov 26, 2021 Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 01/16] drm/amd/display: Enable P010 for DCN3x ASICs Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 02/16] drm/amd/display: Allow DSC on supported MST branch devices Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 03/16] drm/amd/display: add hdmi disable debug check Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 04/16] drm/amd/display: Clear DPCD lane settings after repeater training Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 05/16] drm/amd/display: Fix for otg synchronization logic Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 06/16] drm/amd/display: Fix for the no Audio bug with Tiled Displays Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 07/16] drm/amd/display: add function for eDP and backlight power on Bhawanpreet Lakha
2021-11-26 19:49 ` Bhawanpreet Lakha [this message]
2021-11-26 19:49 ` [PATCH 09/16] drm/amd/display: Fix dual eDP abnormal display issue Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 10/16] drm/amd/display: PSR panel capability debugfs Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 11/16] drm/amd/display: Add vendor specific LTTPR workarounds for DCN31 Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 12/16] drm/amd/display: Skip vendor specific LTTPR w/a outside link training Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 13/16] drm/amd/display: Add force detile buffer size debug flag Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 14/16] drm/amd/display: Add 16ms AUX RD interval W/A for specific LTTPR Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 15/16] drm/amd/display: [FW Promotion] Release 0.0.95 Bhawanpreet Lakha
2021-11-26 19:49 ` [PATCH 16/16] drm/amd/display: 3.2.164 Bhawanpreet Lakha
2021-11-29 14:16 ` [PATCH 00/16] DC Patches Nov 26, 2021 Wheeler, Daniel

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=20211126194922.816835-9-Bhawanpreet.Lakha@amd.com \
    --to=bhawanpreet.lakha@amd.com \
    --cc=Anson.Jacob@amd.com \
    --cc=Aric.Cyr@amd.com \
    --cc=Aurabindo.Pillai@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Jimmy.Kizito@amd.com \
    --cc=Jun.Lei@amd.com \
    --cc=Rodrigo.Siqueira@amd.com \
    --cc=Sunpeng.Li@amd.com \
    --cc=agustin.gutierrez@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=mikita.lipski@amd.com \
    --cc=pavle.kotarac@amd.com \
    --cc=qingqing.zhuo@amd.com \
    --cc=roman.li@amd.com \
    --cc=solomon.chiu@amd.com \
    --cc=stylon.wang@amd.com \
    --cc=wayne.lin@amd.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.