]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/amd/display: Cleanup uses of the analog flag
authorTimur Kristóf <timur.kristof@gmail.com>
Thu, 13 Nov 2025 16:33:46 +0000 (17:33 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 18 Nov 2025 15:53:10 +0000 (10:53 -0500)
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>
Link: https://lore.kernel.org/r/20251113163348.137315-3-timur.kristof@gmail.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/dc/link/link_detection.c

index 35ca6a0846110273d47c930055ccad40e1f55718..c60b2a4f6a66144fbb92ea67c8f03c555b342fc8 100644 (file)
@@ -8820,8 +8820,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)
@@ -8848,7 +8854,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.
                         */
index d163360a2bf67bb1b644caa899b8b2ad0b82bab0..6d31f4967f1a972a9e49ecf4269efb86bb694038 100644 (file)
@@ -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))