Skip to content

Commit ffdaeb1

Browse files
Paul Hsiehalexdeucher
authored andcommitted
drm/amd/display: reallocate MST payload when link loss
[Why] Try to allocate MST payload but receive HPD short pulse with link loss casue driver allocate payload twice. It cause monitor can't light up successfully. [How] When driver receive HPD short pulse with link loss, we need to deallocate payload then allocate payload. Then we will not allocate payload twice with same sink. Signed-off-by: Paul Hsieh <[email protected]> Reviewed-by: Tony Cheng <[email protected]> Acked-by: Harry Wentland <[email protected]> Acked-by: Rodrigo Siqueira <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 34ad023 commit ffdaeb1

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2873,6 +2873,39 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
28732873

28742874
return DC_OK;
28752875
}
2876+
2877+
enum dc_status dc_link_reallocate_mst_payload(struct dc_link *link)
2878+
{
2879+
int i;
2880+
struct pipe_ctx *pipe_ctx;
2881+
2882+
// Clear all of MST payload then reallocate
2883+
for (i = 0; i < MAX_PIPES; i++) {
2884+
pipe_ctx = &link->dc->current_state->res_ctx.pipe_ctx[i];
2885+
if (pipe_ctx && pipe_ctx->stream && pipe_ctx->stream->link == link &&
2886+
pipe_ctx->stream->dpms_off == false &&
2887+
pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
2888+
deallocate_mst_payload(pipe_ctx);
2889+
}
2890+
}
2891+
2892+
for (i = 0; i < MAX_PIPES; i++) {
2893+
pipe_ctx = &link->dc->current_state->res_ctx.pipe_ctx[i];
2894+
if (pipe_ctx && pipe_ctx->stream && pipe_ctx->stream->link == link &&
2895+
pipe_ctx->stream->dpms_off == false &&
2896+
pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
2897+
/* enable/disable PHY will clear connection between BE and FE
2898+
* need to restore it.
2899+
*/
2900+
link->link_enc->funcs->connect_dig_be_to_fe(link->link_enc,
2901+
pipe_ctx->stream_res.stream_enc->id, true);
2902+
dc_link_allocate_mst_payload(pipe_ctx);
2903+
}
2904+
}
2905+
2906+
return DC_OK;
2907+
}
2908+
28762909
#if defined(CONFIG_DRM_AMD_DC_HDCP)
28772910
static void update_psp_stream_config(struct pipe_ctx *pipe_ctx, bool dpms_off)
28782911
{

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2901,11 +2901,8 @@ bool dc_link_handle_hpd_rx_irq(struct dc_link *link, union hpd_irq_data *out_hpd
29012901
pipe_ctx,
29022902
pipe_ctx->stream->signal);
29032903

2904-
if (pipe_ctx && pipe_ctx->stream && pipe_ctx->stream->link == link &&
2905-
pipe_ctx->stream->dpms_off == false &&
2906-
pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST) {
2907-
dc_link_allocate_mst_payload(pipe_ctx);
2908-
}
2904+
if (pipe_ctx->stream->signal == SIGNAL_TYPE_DISPLAY_PORT_MST)
2905+
dc_link_reallocate_mst_payload(link);
29092906

29102907
status = false;
29112908
if (out_link_loss)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,7 @@ enum dc_detect_reason {
205205
bool dc_link_detect(struct dc_link *dc_link, enum dc_detect_reason reason);
206206
bool dc_link_get_hpd_state(struct dc_link *dc_link);
207207
enum dc_status dc_link_allocate_mst_payload(struct pipe_ctx *pipe_ctx);
208+
enum dc_status dc_link_reallocate_mst_payload(struct dc_link *link);
208209

209210
/* Notify DC about DP RX Interrupt (aka Short Pulse Interrupt).
210211
* Return:

0 commit comments

Comments
 (0)