xserver/hw/xfree86/drivers/modesetting
Mario Kleiner efe9e3e9ff modesetting: Fix fallback for lack of new vblank kernel API.
Turns out that the kernel DRM ioctl handling returns EINVAL
instead of ENOTTY if one tries to call the new drmCrtcGetSequence()
or drmCrtcQueueSequence() ioctl's introduced in Linux 4.15 on an
older kernel where they are missing. This causes the fallback code
not to fall back to the old drmWaitVblank() ioctl and thereby
failure of vblank stuff.

E.g., on Linux 4.13, glxgears -info runs unthrottled at 10000 fps
instead of 60 fps. Also breakage of OML_sync_control extension.

Check for errno != EINVAL before setting has_queue_sequence = TRUE.

Additionally in case of supported drmCrtcQueueSequence(), set
has_queue_sequence = TRUE on success, or we might get at
least a temporary failure in ms_queue_vblank().

One slight ambiguity is that we can also get EINVAL if
drm_crtc_vblank_get() fails in the kernel, so if that
happened at first invocation of the new api, we'd fall
back to drmWaitVblank() and then fail there, instead of
failing in the new api, but the end result would be the
same.

Fixes: 44d5f2eb8a ("xf86-video-modesetting: Support new vblank kernel API [v2]")
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Cc: Keith Packard <keithp@keithp.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-02-27 10:02:05 -05:00
..
Makefile.am shadow: Lift 32->24 conversion from modesetting to dix 2016-12-12 14:10:44 -05:00
dri2.c modesetting: Check for -1 before converting to unsigned int. 2018-02-02 15:19:32 -05:00
driver.c modesetting: Do not close uninitialized dri2 screen 2018-02-26 16:41:42 -05:00
driver.h miinitext: General cleanup (v2) 2018-01-22 17:28:12 -05:00
drmmode_display.c xf86-video-modesetting: Update property values at detect and uevent time 2018-01-22 17:22:21 -05:00
drmmode_display.h modesetting: Do not close uninitialized dri2 screen 2018-02-26 16:41:42 -05:00
dumb_bo.c modesetting: Include dix-config.h from dumb_bo.c 2015-05-12 08:02:11 -07:00
dumb_bo.h modesetting: Drop dumb_bo::map_count field and dead unmap code. 2014-12-11 11:26:19 -08:00
meson.build meson: Fix test for whether we've built glamor-EGL. 2017-06-13 10:36:18 -04:00
modesetting.man modesetting: Add more missing options to man page. 2015-08-13 00:36:12 +01:00
pageflip.c modesetting: Drop code for GLAMOR && !GLAMOR_HAS_GBM. 2017-05-18 11:33:05 -04:00
present.c xf86-video-modesetting: Add ms_queue_vblank helper [v3] 2017-10-04 15:17:41 -04:00
vblank.c modesetting: Fix fallback for lack of new vblank kernel API. 2018-02-27 10:02:05 -05:00