AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Timur Kristóf" <timur.kristof@gmail.com>
To: amd-gfx@lists.freedesktop.org, Ray.Wu@amd.com,
	Harry.Wentland@amd.com, Alex.Hung@amd.com, Wenjing.Liu@amd.com,
	Chris.Park@amd.com, Yu.Wang4@amd.com
Cc: "Timur Kristóf" <timur.kristof@gmail.com>,
	"Harry Wentland" <harry.wentland@amd.com>
Subject: [PATCH 2/4] drm/amd/display: Cleanup uses of the analog flag
Date: Thu, 13 Nov 2025 17:33:46 +0100	[thread overview]
Message-ID: <20251113163348.137315-3-timur.kristof@gmail.com> (raw)
In-Reply-To: <20251113163348.137315-1-timur.kristof@gmail.com>

In the detect_link_and_local_sink() function, do not modify the
EDID capabilities of the display based on the connector. Instead,
respect the analog flag better and when the analog flag is set,
check that the connector indeed supports analog displays.

Suggested-by: Ray Wu <Ray.Wu@amd.com>
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 ++++++++++++---
 .../gpu/drm/amd/display/dc/link/link_detection.c  |  2 --
 2 files changed, 12 insertions(+), 5 deletions(-)

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 aa31e969b39d..9703f7fc957d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -8665,8 +8665,14 @@ static void amdgpu_dm_connector_add_freesync_modes(struct drm_connector *connect
 	if (!(amdgpu_freesync_vid_mode && drm_edid))
 		return;
 
-	if (!amdgpu_dm_connector->dc_sink || amdgpu_dm_connector->dc_sink->edid_caps.analog ||
-		!dc_supports_vrr(amdgpu_dm_connector->dc_sink->ctx->dce_version))
+	if (!amdgpu_dm_connector->dc_sink || !amdgpu_dm_connector->dc_link)
+		return;
+
+	if (!dc_supports_vrr(amdgpu_dm_connector->dc_sink->ctx->dce_version))
+		return;
+
+	if (dc_connector_supports_analog(amdgpu_dm_connector->dc_link->link_id.id) &&
+	    amdgpu_dm_connector->dc_sink->edid_caps.analog)
 		return;
 
 	if (amdgpu_dm_connector->max_vfreq - amdgpu_dm_connector->min_vfreq > 10)
@@ -8693,7 +8699,10 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
 			amdgpu_dm_connector->num_modes +=
 				drm_add_modes_noedid(connector, 1920, 1080);
 
-		if (amdgpu_dm_connector->dc_sink && amdgpu_dm_connector->dc_sink->edid_caps.analog) {
+		if (amdgpu_dm_connector->dc_sink &&
+		    amdgpu_dm_connector->dc_link &&
+		    amdgpu_dm_connector->dc_sink->edid_caps.analog &&
+		    dc_connector_supports_analog(amdgpu_dm_connector->dc_link->link_id.id)) {
 			/* Analog monitor connected by DAC load detection.
 			 * Add common modes. It will be up to the user to select one that works.
 			 */
diff --git a/drivers/gpu/drm/amd/display/dc/link/link_detection.c b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
index d163360a2bf6..6d31f4967f1a 100644
--- a/drivers/gpu/drm/amd/display/dc/link/link_detection.c
+++ b/drivers/gpu/drm/amd/display/dc/link/link_detection.c
@@ -1224,8 +1224,6 @@ static bool detect_link_and_local_sink(struct dc_link *link,
 			break;
 		}
 
-		sink->edid_caps.analog &= dc_connector_supports_analog(link->link_id.id);
-
 		// Check if edid is the same
 		if ((prev_sink) &&
 		    (edid_status == EDID_THE_SAME || edid_status == EDID_OK))
-- 
2.51.1


  parent reply	other threads:[~2025-11-13 16:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13 16:33 [PATCH 0/4] drm/amd/display: Follow-up patches to analog support Timur Kristóf
2025-11-13 16:33 ` [PATCH 1/4] drm/amd/display: Fix warning for analog stream encoders Timur Kristóf
2025-11-17 20:16   ` Kees Cook
2025-11-19  1:48     ` Alex Hung
2025-11-13 16:33 ` Timur Kristóf [this message]
2025-11-13 16:33 ` [PATCH 3/4] drm/amd/display: Cleanup early return in construct_phy Timur Kristóf
2025-11-13 16:33 ` [PATCH 4/4] drm/amd/display: Move analog check to dce110_hwseq Timur Kristóf
2025-11-17 22:18 ` [PATCH 0/4] drm/amd/display: Follow-up patches to analog support Mario Limonciello
2025-11-18 10:10   ` timur.kristof

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251113163348.137315-3-timur.kristof@gmail.com \
    --to=timur.kristof@gmail.com \
    --cc=Alex.Hung@amd.com \
    --cc=Chris.Park@amd.com \
    --cc=Harry.Wentland@amd.com \
    --cc=Ray.Wu@amd.com \
    --cc=Wenjing.Liu@amd.com \
    --cc=Yu.Wang4@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox