drm/amd/display: edp do not add non-edid timings
authorjsg <jsg@openbsd.org>
Thu, 22 Jun 2023 05:08:30 +0000 (05:08 +0000)
committerjsg <jsg@openbsd.org>
Thu, 22 Jun 2023 05:08:30 +0000 (05:08 +0000)
From Hersen Wu
ee8c6580c3106b0061c7cdff1804e5a1f1e1d7fe in linux-6.1.y/6.1.35
e749dd10e5f292061ad63d2b030194bf7d7d452c in mainline linux

sys/dev/pci/drm/amd/display/amdgpu_dm/amdgpu_dm.c

index b3d59c1..46bbe7c 100644 (file)
@@ -6944,7 +6944,13 @@ static int amdgpu_dm_connector_get_modes(struct drm_connector *connector)
                                drm_add_modes_noedid(connector, 640, 480);
        } else {
                amdgpu_dm_connector_ddc_get_modes(connector, edid);
-               amdgpu_dm_connector_add_common_modes(encoder, connector);
+               /* most eDP supports only timings from its edid,
+                * usually only detailed timings are available
+                * from eDP edid. timings which are not from edid
+                * may damage eDP
+                */
+               if (connector->connector_type != DRM_MODE_CONNECTOR_eDP)
+                       amdgpu_dm_connector_add_common_modes(encoder, connector);
                amdgpu_dm_connector_add_freesync_modes(connector, edid);
        }
        amdgpu_dm_fbc_init(connector);