Skip to contentSkip to conversation

FAILED: patch "[PATCH] drm/amd/display: Don't replace a sink mode that shares the" failed to apply to 6.1-stable tree

PATCH Applied [email protected] 3 participants 3 messages Oct 12 – Oct 14

Subsystems (4)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

The patch below does not apply to the 6.1-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y
git checkout FETCH_HEAD
git cherry-pick -x 54c998c55fc9cbc391b350d67b86e0c2a0748f1a
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026101219-direction-scrounger-fdc4@gregkh' --subject-prefix 'PATCH 6.1.y' 'HEAD^..'

Possible dependencies:

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 54c998c55fc9cbc391b350d67b86e0c2a0748f1a Mon Sep 17 00:00:00 2001
From: Adrian Betschart <[email protected]>
Date: Fri, 25 Sep 2026 09:48:29 +0200
Subject: [PATCH] drm/amd/display: Don't replace a sink mode that shares the
native totals

decide_crtc_timing_for_drm_display_mode() copies the native mode's CRTC timing into the requested mode when clock, htotal and vtotal match. That is meant for the modes amdgpu inserts itself:
amdgpu_dm_create_common_mode() duplicates the native mode and changes only hdisplay and vdisplay, so those are sent with the native timing and scaled.

A sink can also offer a real mode with the same clock and totals as its native mode. CTA-861 VIC 102 (4096x2160@60) and VIC 97 (3840x2160@60) both use 594 MHz and 4400x2250. With 3840x2160@60 as the preferred mode, a 4096x2160@60 request goes out with the 3840x2160 timing and the framebuffer scaled into it (dst 3840x2025 at y=67), while the AVI InfoFrame still carries VIC 102. A JVC projector then reports 3840x2160 and shows a corrupted right edge. 4096x2160@24, whose totals differ, is sent and displayed correctly.

Inserted modes keep the native sync positions; a real mode with its own active width does not. Compare those too, so only inserted modes are patched.

Fixes 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)")
Assisted-by Claude-Code:claude-opus-5-5
(cherry picked from commit 22f9a2da101c37f821cd00954f81dc598754f4d5)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c +6 -1
index d386bb1475bb..45a69bf43971 100644
@@ -1012,10 +1012,15 @@ decide_crtc_timing_for_drm_display_mode(struct drm_display_mode *drm_mode,
 					const struct drm_display_mode *native_mode,
 					bool scale_enabled)
 {
+	/* Inserted modes copy the native sync; a sink mode with equal totals may not */
 	if (scale_enabled || (
 	    native_mode->clock == drm_mode->clock &&
 	    native_mode->htotal == drm_mode->htotal &&
-	    native_mode->vtotal == drm_mode->vtotal)) {
+	    native_mode->vtotal == drm_mode->vtotal &&
+	    native_mode->hsync_start == drm_mode->hsync_start &&
+	    native_mode->hsync_end == drm_mode->hsync_end &&
+	    native_mode->vsync_start == drm_mode->vsync_start &&
+	    native_mode->vsync_end == drm_mode->vsync_end)) {
 		if (native_mode->crtc_clock)
 			copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
 	} else {
drivers/gpu/drm/amd/display/amdgpu_dm/tests/amdgpu_dm_connector_test.c +42 -0

54 lines not on this page · raw message

#1 lore raw

PATCH 1/1 drm/amd/display: Don't replace a sink mode that shares the native totals

decide_crtc_timing_for_drm_display_mode() copies the native mode's CRTC timing into the requested mode when clock, htotal and vtotal match. That is meant for the modes amdgpu inserts itself:
amdgpu_dm_create_common_mode() duplicates the native mode and changes only hdisplay and vdisplay, so those are sent with the native timing and scaled.

A sink can also offer a real mode with the same clock and totals as its native mode. CTA-861 VIC 102 (4096x2160@60) and VIC 97 (3840x2160@60) both use 594 MHz and 4400x2250. With 3840x2160@60 as the preferred mode, a 4096x2160@60 request goes out with the 3840x2160 timing and the framebuffer scaled into it (dst 3840x2025 at y=67), while the AVI InfoFrame still carries VIC 102. A JVC projector then reports 3840x2160 and shows a corrupted right edge. 4096x2160@24, whose totals differ, is sent and displayed correctly.

Inserted modes keep the native sync positions; a real mode with its own active width does not. Compare those too, so only inserted modes are patched.

Fixes 4562236b3bc0 ("drm/amd/dc: Add dc display driver (v2)")
Assisted-by Claude-Code:claude-opus-5-5
(cherry picked from commit 22f9a2da101c37f821cd00954f81dc598754f4d5)
(cherry picked from commit 54c998c55fc9cbc391b350d67b86e0c2a0748f1a)

[ Adrian: this tree keeps the function in amdgpu_dm.c, with the equal-totals
case as its own else-if; added the sync checks there. Dropped the KUnit test, its file does not exist here. ]

Assisted-by Claude-Code:claude-opus-5-5
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +6 -1
index deaf98957cb7..813b68217df7 100644
@@ -5602,11 +5602,16 @@ decide_crtc_timing_for_drm_display_mode(struct drm_display_mode *drm_mode,
 					const struct drm_display_mode *native_mode,
 					bool scale_enabled)
 {
+	/* Inserted modes copy the native sync; a sink mode with equal totals may not */
 	if (scale_enabled) {
 		copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
 	} else if (native_mode->clock == drm_mode->clock &&
 			native_mode->htotal == drm_mode->htotal &&
-			native_mode->vtotal == drm_mode->vtotal) {
+			native_mode->vtotal == drm_mode->vtotal &&
+			native_mode->hsync_start == drm_mode->hsync_start &&
+			native_mode->hsync_end == drm_mode->hsync_end &&
+			native_mode->vsync_start == drm_mode->vsync_start &&
+			native_mode->vsync_end == drm_mode->vsync_end) {
 		copy_crtc_timing_for_drm_display_mode(native_mode, drm_mode);
 	} else {
 		/* no scaling nor amdgpu inserted, no need to patch */
Signature · 1 line
2.56.0
maintainer Applied
#2 lore raw

Re: [PATCH 6.1.y] drm/amd/display: Don't replace a sink mode that shares the native totals

Quoted 3 lines

Inserted modes keep the native sync positions; a real mode with its own active width does not. Compare those too, so only inserted modes are patched.

Queued for 6.1, thanks.

Signature · 2 lines
Thanks,
Sasha