diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-08-29 08:25:09 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-08-29 08:25:09 +0100 |
commit | 74e4c131daf99eec381c77bef6611111e74da502 (patch) | |
tree | 117a65ae902180dc9afbe2a08e3e7896bca7219f | |
parent | 71d32739db7c5dd93d71bad9c4de049f82524ceb (diff) |
sna: Limit the guessed modes by clock rate
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_display.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 96793281..cde4ca23 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -3901,7 +3901,7 @@ sna_output_add_default_modes(xf86OutputPtr output, DisplayModePtr modes) { xf86MonPtr mon = output->MonInfo; DisplayModePtr i, m, preferred = NULL; - int max_x = 0, max_y = 0; + int max_x = 0, max_y = 0, max_clock = 0; float max_vrefresh = 0.0; if (mon && GTF_SUPPORTED(mon->features.msc)) @@ -3912,16 +3912,17 @@ sna_output_add_default_modes(xf86OutputPtr output, DisplayModePtr modes) preferred = m; max_x = max(max_x, m->HDisplay); max_y = max(max_y, m->VDisplay); + max_clock = max(max_clock, m->Clock); max_vrefresh = max(max_vrefresh, xf86ModeVRefresh(m)); } - - max_vrefresh = max(max_vrefresh, 60.0); max_vrefresh *= (1 + SYNC_TOLERANCE); m = default_modes(preferred); xf86ValidateModesSize(output->scrn, m, max_x, max_y, 0); for (i = m; i; i = i->next) { + if (i->Clock > max_clock) + i->status = MODE_CLOCK_HIGH; if (xf86ModeVRefresh(i) > max_vrefresh) i->status = MODE_VSYNC; if (preferred && |