Skip to content

Commit c9beecc

Browse files
Jimmy Kizitoalexdeucher
authored andcommitted
drm/amd/display: Add work around for tunneled MST.
[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 <[email protected]> Reviewed-by: Aric Cyr <[email protected]> Acked-by: Bhawanpreet Lakha <[email protected]> Signed-off-by: Jimmy Kizito <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 5ceaebc commit c9beecc

File tree

4 files changed

+30
-11
lines changed

4 files changed

+30
-11
lines changed

drivers/gpu/drm/amd/display/dc/core/dc_link.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,18 @@ static bool detect_dp(struct dc_link *link,
758758
dal_ddc_service_set_transaction_type(link->ddc,
759759
sink_caps->transaction_type);
760760

761+
#if defined(CONFIG_DRM_AMD_DC_DCN)
762+
/* Apply work around for tunneled MST on certain USB4 docks. Always use DSC if dock
763+
* reports DSC support.
764+
*/
765+
if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA &&
766+
link->type == dc_connection_mst_branch &&
767+
link->dpcd_caps.branch_dev_id == DP_BRANCH_DEVICE_ID_90CC24 &&
768+
link->dpcd_caps.dsc_caps.dsc_basic_caps.fields.dsc_support.DSC_SUPPORT &&
769+
!link->dc->debug.dpia_debug.bits.disable_mst_dsc_work_around)
770+
link->wa_flags.dpia_mst_dsc_always_on = true;
771+
#endif
772+
761773
#if defined(CONFIG_DRM_AMD_DC_HDCP)
762774
/* In case of fallback to SST when topology discovery below fails
763775
* 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,
12031215
LINK_INFO("link=%d, mst branch is now Disconnected\n",
12041216
link->link_index);
12051217

1218+
/* Disable work around which keeps DSC on for tunneled MST on certain USB4 docks. */
1219+
if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA)
1220+
link->wa_flags.dpia_mst_dsc_always_on = false;
1221+
12061222
dm_helpers_dp_mst_stop_top_mgr(link->ctx, link);
12071223

12081224
link->mst_stream_alloc_table.stream_count = 0;

drivers/gpu/drm/amd/display/dc/core/dc_resource.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,16 +2256,6 @@ enum dc_status dc_validate_global_state(
22562256

22572257
if (!new_ctx)
22582258
return DC_ERROR_UNEXPECTED;
2259-
#if defined(CONFIG_DRM_AMD_DC_DCN)
2260-
2261-
/*
2262-
* Update link encoder to stream assignment.
2263-
* TODO: Split out reason allocation from validation.
2264-
*/
2265-
if (dc->res_pool->funcs->link_encs_assign && fast_validate == false)
2266-
dc->res_pool->funcs->link_encs_assign(
2267-
dc, new_ctx, new_ctx->streams, new_ctx->stream_count);
2268-
#endif
22692259

22702260
if (dc->res_pool->funcs->validate_global) {
22712261
result = dc->res_pool->funcs->validate_global(dc, new_ctx);
@@ -2317,6 +2307,16 @@ enum dc_status dc_validate_global_state(
23172307
if (!dc->res_pool->funcs->validate_bandwidth(dc, new_ctx, fast_validate))
23182308
result = DC_FAIL_BANDWIDTH_VALIDATE;
23192309

2310+
#if defined(CONFIG_DRM_AMD_DC_DCN)
2311+
/*
2312+
* Only update link encoder to stream assignment after bandwidth validation passed.
2313+
* TODO: Split out assignment and validation.
2314+
*/
2315+
if (result == DC_OK && dc->res_pool->funcs->link_encs_assign && fast_validate == false)
2316+
dc->res_pool->funcs->link_encs_assign(
2317+
dc, new_ctx, new_ctx->streams, new_ctx->stream_count);
2318+
#endif
2319+
23202320
return result;
23212321
}
23222322

drivers/gpu/drm/amd/display/dc/dc.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,8 @@ union dpia_debug_options {
508508
uint32_t disable_dpia:1;
509509
uint32_t force_non_lttpr:1;
510510
uint32_t extend_aux_rd_interval:1;
511-
uint32_t reserved:29;
511+
uint32_t disable_mst_dsc_work_around:1;
512+
uint32_t reserved:28;
512513
} bits;
513514
uint32_t raw;
514515
};

drivers/gpu/drm/amd/display/dc/dc_link.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ struct dc_link {
191191
bool dp_skip_DID2;
192192
bool dp_skip_reset_segment;
193193
bool dp_mot_reset_segment;
194+
/* Some USB4 docks do not handle turning off MST DSC once it has been enabled. */
195+
bool dpia_mst_dsc_always_on;
194196
} wa_flags;
195197
struct link_mst_stream_allocation_table mst_stream_alloc_table;
196198

0 commit comments

Comments
 (0)