drm/amd/display: Add refresh rate range check
authorjsg <jsg@openbsd.org>
Fri, 26 Jul 2024 03:34:59 +0000 (03:34 +0000)
committerjsg <jsg@openbsd.org>
Fri, 26 Jul 2024 03:34:59 +0000 (03:34 +0000)
From Tom Chung
531e7852fb62bfc6a15cc1df85f62720f704d537 in linux-6.6.y/6.6.42
74ad26b36d303ac233eccadc5c3a8d7ee4709f31 in mainline linux

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

index 4aeaaa5..43cd301 100644 (file)
@@ -10766,9 +10766,11 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
                if (is_dp_capable_without_timing_msa(adev->dm.dc,
                                                     amdgpu_dm_connector)) {
                        if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) {
-                               freesync_capable = true;
                                amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;
                                amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq;
+                               if (amdgpu_dm_connector->max_vfreq -
+                                   amdgpu_dm_connector->min_vfreq > 10)
+                                       freesync_capable = true;
                        } else {
                                edid_check_required = edid->version > 1 ||
                                                      (edid->version == 1 &&