]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Increase EDID read retries
authorMario Limonciello (AMD) <superm1@kernel.org>
Thu, 6 Nov 2025 05:04:54 +0000 (23:04 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 26 Nov 2025 17:32:05 +0000 (12:32 -0500)
[WHY]
When monitor is still booting EDID read can fail while DPCD read
is successful.  In this case no EDID data will be returned, and this
could happen for a while.

[HOW]
Increase number of attempts to read EDID in dm_helpers_read_local_edid()
to 25.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/4672
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Signed-off-by: Alex Hung <alex.hung@amd.com>
Tested-by: Dan Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit a76d6f2c76c3abac519ba753e2723e6ffe8e461c)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c

index cc21337a182f5314f925a81be89a19a3c4e999a0..d0f770dd0a9568f5ee8dd24e676ec058f5397374 100644 (file)
@@ -997,8 +997,8 @@ enum dc_edid_status dm_helpers_read_local_edid(
        struct amdgpu_dm_connector *aconnector = link->priv;
        struct drm_connector *connector = &aconnector->base;
        struct i2c_adapter *ddc;
-       int retry = 3;
-       enum dc_edid_status edid_status;
+       int retry = 25;
+       enum dc_edid_status edid_status = EDID_NO_RESPONSE;
        const struct drm_edid *drm_edid;
        const struct edid *edid;
 
@@ -1028,7 +1028,7 @@ enum dc_edid_status dm_helpers_read_local_edid(
                }
 
                if (!drm_edid)
-                       return EDID_NO_RESPONSE;
+                       continue;
 
                edid = drm_edid_raw(drm_edid); // FIXME: Get rid of drm_edid_raw()
                if (!edid ||
@@ -1046,7 +1046,7 @@ enum dc_edid_status dm_helpers_read_local_edid(
                                                &sink->dc_edid,
                                                &sink->edid_caps);
 
-       } while (edid_status == EDID_BAD_CHECKSUM && --retry > 0);
+       } while ((edid_status == EDID_BAD_CHECKSUM || edid_status == EDID_NO_RESPONSE) && --retry > 0);
 
        if (edid_status != EDID_OK)
                DRM_ERROR("EDID err: %d, on connector: %s",