drm/amd/display: edp do not add non-edid timings
authorjsg <jsg@openbsd.org>
Wed, 26 Jul 2023 06:26:05 +0000 (06:26 +0000)
committerjsg <jsg@openbsd.org>
Wed, 26 Jul 2023 06:26:05 +0000 (06:26 +0000)
From Hersen Wu
c4629c757528f87ee22ea8fe16c645e471b9cbf6 in linux-6.1.y/6.1.40
7a0e005c7957931689a327b2a4e7333a19f13f95 in mainline linux

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

index 188708e..21e07a1 100644 (file)
@@ -6974,7 +6974,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);