From: "Mario Limonciello (AMD)" <[email protected]>

[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 <[email protected]>
Cc: Alex Deucher <[email protected]>
Cc: [email protected]
Reviewed-by: Alex Hung <[email protected]>
Signed-off-by: Mario Limonciello (AMD) <[email protected]>
Signed-off-by: Alex Hung <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
index 582a1c04f035..e5e993d3ef74 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
@@ -1006,8 +1006,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;
 
@@ -1037,7 +1037,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 ||
@@ -1055,7 +1055,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",
-- 
2.43.0

Reply via email to