egl: add dri2_setup_swap_interval helper
authorEmil Velikov <emil.velikov@collabora.com>
Fri, 4 Aug 2017 23:25:46 +0000 (00:25 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 10 Aug 2017 18:23:31 +0000 (19:23 +0100)
commit47b06f5821551375e98699ca8ea41d06dc4ba0e9
treec222901e59d22e1af94f0495413837515c43e5a1
parent4d9b0dcccb81ad10113d9aef52b4c84496e879f1
egl: add dri2_setup_swap_interval helper

The current two implementations - X11 and Wayland were identical,
barrind the upper limit.

Instead of having same code twice - introduce a helper and pass the
limit as an argument.

Thus as Android/DRM/others get support - they only need to call the
function ;-)

v2: Rebase on top of keeping ::swap_available

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
src/egl/drivers/dri2/egl_dri2.c
src/egl/drivers/dri2/egl_dri2.h
src/egl/drivers/dri2/platform_wayland.c
src/egl/drivers/dri2/platform_x11.c