drm/amd/display: Drop to fail-safe mode if edid is bad
authorMikita Lipski <mikita.lipski@amd.com>
Tue, 22 May 2018 19:55:43 +0000 (15:55 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 15 Jun 2018 17:22:01 +0000 (12:22 -0500)
Provide the connector with a single fail-safe mode of 640x480 for CTS
tests instead of providing a list of possible base modes.

Signed-off-by: Mikita Lipski <mikita.lipski@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index adeb795..b1b8d19 100644 (file)
@@ -3424,6 +3424,10 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
        struct edid *edid = amdgpu_dm_connector->edid;
 
        encoder = helper->best_encoder(connector);
+
+       if (!edid || !drm_edid_is_valid(edid))
+               return drm_add_modes_noedid(connector, 640, 480);
+
        amdgpu_dm_connector_ddc_get_modes(connector, edid);
        amdgpu_dm_connector_add_common_modes(encoder, connector);