From: Greg Kroah-Hartman Date: Thu, 15 Aug 2024 12:35:45 +0000 (+0200) Subject: 6.10-stable patches X-Git-Tag: v4.19.320~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=20c6e3cd2ec705ff548dddc80feb6799c30cd59b;p=thirdparty%2Fkernel%2Fstable-queue.git 6.10-stable patches added patches: drm-amd-display-solve-mst-monitors-blank-out-problem-after-resume.patch drm-amdgpu-display-fix-null-pointer-dereference-in-dc_stream_program_cursor_position.patch --- diff --git a/queue-6.10/drm-amd-display-solve-mst-monitors-blank-out-problem-after-resume.patch b/queue-6.10/drm-amd-display-solve-mst-monitors-blank-out-problem-after-resume.patch new file mode 100644 index 00000000000..4c613c64ea5 --- /dev/null +++ b/queue-6.10/drm-amd-display-solve-mst-monitors-blank-out-problem-after-resume.patch @@ -0,0 +1,47 @@ +From e33697141bac18906345ea46533a240f1ad3cd21 Mon Sep 17 00:00:00 2001 +From: Wayne Lin +Date: Thu, 23 May 2024 12:18:07 +0800 +Subject: drm/amd/display: Solve mst monitors blank out problem after resume + +From: Wayne Lin + +commit e33697141bac18906345ea46533a240f1ad3cd21 upstream. + +[Why] +In dm resume, we firstly restore dc state and do the mst resume for topology +probing thereafter. If we change dpcd DP_MSTM_CTRL value after LT in mst reume, +it will cause light up problem on the hub. + +[How] +Revert commit 202dc359adda ("drm/amd/display: Defer handling mst up request in resume"). +And adjust the reason to trigger dc_link_detect by DETECT_REASON_RESUMEFROMS3S4. + +Cc: stable@vger.kernel.org +Fixes: 202dc359adda ("drm/amd/display: Defer handling mst up request in resume") +Signed-off-by: Wayne Lin +Reviewed-by: Fangzhi Zuo +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c ++++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +@@ -2418,6 +2418,7 @@ static void resume_mst_branch_status(str + + ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, + DP_MST_EN | ++ DP_UP_REQ_EN | + DP_UPSTREAM_IS_SRC); + if (ret < 0) { + drm_dbg_kms(mgr->dev, "mst write failed - undocked during suspend?\n"); +@@ -3017,7 +3018,7 @@ static int dm_resume(void *handle) + } else { + mutex_lock(&dm->dc_lock); + dc_exit_ips_for_hw_access(dm->dc); +- dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD); ++ dc_link_detect(aconnector->dc_link, DETECT_REASON_RESUMEFROMS3S4); + mutex_unlock(&dm->dc_lock); + } + diff --git a/queue-6.10/drm-amdgpu-display-fix-null-pointer-dereference-in-dc_stream_program_cursor_position.patch b/queue-6.10/drm-amdgpu-display-fix-null-pointer-dereference-in-dc_stream_program_cursor_position.patch new file mode 100644 index 00000000000..3bf0fdb9760 --- /dev/null +++ b/queue-6.10/drm-amdgpu-display-fix-null-pointer-dereference-in-dc_stream_program_cursor_position.patch @@ -0,0 +1,74 @@ +From fa4c500ce93f4f933c38e6d6388970e121e27b21 Mon Sep 17 00:00:00 2001 +From: Srinivasan Shanmugam +Date: Wed, 22 May 2024 20:54:50 +0530 +Subject: drm/amdgpu/display: Fix null pointer dereference in dc_stream_program_cursor_position + +From: Srinivasan Shanmugam + +commit fa4c500ce93f4f933c38e6d6388970e121e27b21 upstream. + +The fix involves adding a null check for 'stream' at the beginning of +the function. If 'stream' is NULL, the function immediately returns +false. This ensures that 'stream' is not NULL when we dereference it to +access 'ctx' in 'dc = stream->ctx->dc;' the function. + +Fixes the below: + drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:398 dc_stream_program_cursor_position() + error: we previously assumed 'stream' could be null (see line 397) + +drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c + 389 bool dc_stream_program_cursor_position( + 390 struct dc_stream_state *stream, + 391 const struct dc_cursor_position *position) + 392 { + 393 struct dc *dc; + 394 bool reset_idle_optimizations = false; + 395 const struct dc_cursor_position *old_position; + 396 + 397 old_position = stream ? &stream->cursor_position : NULL; + ^^^^^^^^ +The patch adds a NULL check + +--> 398 dc = stream->ctx->dc; + ^^^^^^^^ +The old code didn't check + + 399 + 400 if (dc_stream_set_cursor_position(stream, position)) { + 401 dc_z10_restore(dc); + 402 + 403 /* disable idle optimizations if enabling cursor */ + 404 if (dc->idle_optimizations_allowed && + 405 (!old_position->enable || dc->debug.exit_idle_opt_for_cursor_updates) && + 406 position->enable) { + 407 dc_allow_idle_optimizations(dc, false); + +Fixes: f63f86b5affc ("drm/amd/display: Separate setting and programming of cursor") +Reported-by: Dan Carpenter +Cc: Harry Wentland +Cc: Tom Chung +Cc: Rodrigo Siqueira +Cc: Roman Li +Cc: Aurabindo Pillai +Signed-off-by: Srinivasan Shanmugam +Reviewed-by: Harry Wentland +Signed-off-by: Alex Deucher +Signed-off-by: Greg Kroah-Hartman +--- + drivers/gpu/drm/amd/display/dc/core/dc_stream.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c ++++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c +@@ -394,7 +394,10 @@ bool dc_stream_program_cursor_position( + bool reset_idle_optimizations = false; + const struct dc_cursor_position *old_position; + +- old_position = stream ? &stream->cursor_position : NULL; ++ if (!stream) ++ return false; ++ ++ old_position = &stream->cursor_position; + dc = stream->ctx->dc; + + if (dc_stream_set_cursor_position(stream, position)) { diff --git a/queue-6.10/series b/queue-6.10/series index cf00b48dc41..0e65c9c0b61 100644 --- a/queue-6.10/series +++ b/queue-6.10/series @@ -18,3 +18,5 @@ platform-x86-ideapad-laptop-introduce-a-generic-noti.patch platform-x86-ideapad-laptop-move-ymc_trigger_ec-from.patch platform-x86-ideapad-laptop-add-a-mutex-to-synchroni.patch binfmt_flat-fix-corruption-when-not-offsetting-data-.patch +drm-amd-display-solve-mst-monitors-blank-out-problem-after-resume.patch +drm-amdgpu-display-fix-null-pointer-dereference-in-dc_stream_program_cursor_position.patch