--- hw/xfree86/drivers/modesetting/drmmode_display.c.orig 2016-08-29 15:12:50.802594679 +0800 +++ hw/xfree86/drivers/modesetting/drmmode_display.c 2016-08-29 16:11:40.984319198 +0800 @@ -983,7 +983,8 @@ xf86MonPtr mon = output->MonInfo; DisplayModePtr i, m, preferred = NULL; int max_x = 0, max_y = 0; - float max_vrefresh = 0.0; + float max_vrefresh = 0.0, max_mon_vrefresh = 0.0; + XF86ConfMonitorPtr conf_monitor = output->conf_monitor; if (mon && GTF_SUPPORTED(mon->features.msc)) return Modes; @@ -999,8 +1000,16 @@ max_vrefresh = max(max_vrefresh, xf86ModeVRefresh(m)); } - max_vrefresh = max(max_vrefresh, 60.0); - max_vrefresh *= (1 + SYNC_TOLERANCE); + /* If we have monitor info, read its max vertical refesh + * into max_mon_vrefresh from its reported modelines, + * otherwise default to 60.0 Hz */ + if (conf_monitor && conf_monitor->mon_n_vrefresh > 0) { + for (int index = 0; index < conf_monitor->mon_n_vrefresh; index++) + max_mon_vrefresh = max(max_mon_vrefresh, conf_monitor->mon_vrefresh[index].hi); + } else + max_mon_vrefresh = 60.0 * (1 + SYNC_TOLERANCE); + + max_vrefresh = max(max_vrefresh, max_mon_vrefresh); m = xf86GetDefaultModes(); xf86ValidateModesSize(output->scrn, m, max_x, max_y, 0);