Modesetting driver rejects modes with vertical refresh above 60
Submitted by roc..@..il.com
Assigned to Xorg Project Team
Description
I'm using the modesetting driver in xserver 1.18.4 (1.18.4-1ubuntu4 on Ubuntu 16.10).
For my 4K screen, the driver is rejecting any modelines with vertical refresh above 60, so for instance 2560x1440 is not shown by the modesetting driver, but I can use it with the intel driver.
The reason the modes are rejected is because hw/xfree86/drivers/modesetting/drmmode_display.c#add_gtf_modes() hard-codes the max vertical refresh to 60 + 1%, and since it calculates frequencies of 65 to 85 for the missing modes, it flags them as invalid so later they get pruned. However, my laptop monitor can handle between 56.25 to 120 according to its MonPtr structure, so I think they shouldn't be flagged as invalid.
Would a solution be to have hw/xfree86/drivers/modesetting#get_modes() pass the monitor info (it reads it in already just before the call to add_gtf_modes) and have add_gtf_modes() use the actual monitor maximum refresh? This is what hw/xfree86/modes/xf86Modes.c#xf86ValidateModesSync() appears to do, but it isn't actually passed anything to check in this case.
See also https://bugs.launchpad.net/ubuntu/+source/xorg-server/+bug/1606103 and https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=832432#15.
Version: git