xwayland: Do not enable DRI3 without eventfd

DRI3 version 1.4 which supports explicit buffers synchronization relies
on the eventfd interface.

As result, building would fail with DRI3 enabled on platforms without
the eventfd interface.

Check for the availability of the sys/eventfd.h header and disable DRI3
support if missing.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
(cherry picked from commit 96bdc156a1)

Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1635>
This commit is contained in:
Olivier Fourdan 2024-05-07 13:42:22 +02:00
parent 2a360e5c0f
commit 4d88af2228

View file

@ -332,14 +332,18 @@ endif
libdrm_dep = dependency('libdrm', version: libdrm_req, required: false)
have_eventfd = cc.has_header('sys/eventfd.h')
if get_option('dri3') == 'auto'
build_dri3 = dri3proto_dep.found() and xshmfence_dep.found() and libdrm_dep.found()
build_dri3 = dri3proto_dep.found() and xshmfence_dep.found() and libdrm_dep.found() and have_eventfd
else
build_dri3 = get_option('dri3') == 'true'
if build_dri3
if not xshmfence_dep.found()
error('DRI3 requested, but xshmfence not found')
endif
if not have_eventfd
error('DRI3 requested, but sys/eventfd.h not found')
endif
endif
endif