From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793213434; b=a9tfSNqofDRTIR0xSuOkRS+g04gW6mAfOZEdFqcAPwg5iO5qd/8YacW1DoJ91P3SDmNo dqtjsg4Q5drnGl/iJKrMVY+idxPy24y/a1q7kablbw+R/kdWUjPsh/1yVpHNqoGoupQhs vN6N7DlH0wPsQiAara5g8EPi9iZtO5ed+TSCndhdThl2EuUBfe7iFlSs9mi0+HFQa1yAY kWeZmvS/Lksw4uWUByoY929lQexbWsmTNe3q5L8YPqBVjXMgij7bglrSkP3+ZvDPEzoEW Xrc8ffTdI3mg5DWmZXIf+92jnoCgCViz8qEpuQJN10FD9v4jCWnsKNIgGd6M/2MRU5g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793213434; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=/0B04Up+x+OTtOsXJ3uwOibEwEWinhXd3z9MImQ+GSI=; b=YE+9k76c0i6KHsd/+0/whX38GBaim8lBoVBL4KhPMddygyL5z8ob9OtL4y+COQaseygE 7nDgxbAu7b+z4QmcHlrTrWRfC27zxPuINmKzeh2y2u9aSIBholuCoELqGMzBzrE4vXCY+ luJi0pN2sZanqVzena20am24MTAxqJAr+KIOgSqQM7iNSkai3YCh7S0azh1sy0poQCzb3 0JfFswrHsjugQeRBYgUb3upcO/g+c1k6V0njPr9N9oPYEy2EA+i74C8qjkVNHPyFPI5bU M3bBrLkNEie7j3bh7/Kw2a0j9fMrfj1Gf1RDyWyh7o4jazJhebl6Ugzu0rMTIe/eVgw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=la5PnQbr; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4C76606A31C; Wed, 28 Oct 2026 18:50:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=la5PnQbr Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3BBD1F01828; Wed, 28 Oct 2026 18:50:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1793213433; bh=/0B04Up+x+OTtOsXJ3uwOibEwEWinhXd3z9MImQ+GSI=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=la5PnQbrn5g8AYunOpOsde5ZFN4RwQe4tQaVHWwfZdFZQFfjj9lBmN3z+WuyupekR exX526KhYFYAiebr3L+Ae0zsHQQ3/YdF4tJjOwUDA1+YLmXxxwSBkH7hnw279SygRS GWfB5kSRmJFuongQldo5YT1TD5MpumuZiZiqC9n0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Adrian Betschart , Dan Wheeler , Roman Li , Alex Deucher , Sasha Levin Subject: [PATCH 6.1 0504/1887] drm/amd/display: Dont replace a sink mode that shares the native totals Date: Wed, 28 Oct 2026 17:43:20 +0100 Message-ID: <20261028170510.770587734@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261028170459.200466217@linuxfoundation.org> References: <20261028170459.200466217@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Adrian Betschart commit 54c998c55fc9cbc391b350d67b86e0c2a0748f1a upstream. 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)") Signed-off-by: Adrian Betschart Assisted-by: Claude-Code:claude-opus-5-5 Tested-by: Dan Wheeler Reviewed-by: Roman Li Signed-off-by: Alex Deucher (cherry picked from commit 22f9a2da101c37f821cd00954f81dc598754f4d5) Cc: stable@vger.kernel.org (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. ] Signed-off-by: Adrian Betschart Assisted-by: Claude-Code:claude-opus-5-5 Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 86282119252bd..8c150bf0aa1dd 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -5607,11 +5607,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 */ -- 2.53.0