vaapi: Disable Wayland if no libdrm
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Sun, 30 Jan 2022 08:38:48 +0000 (09:38 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 31 Jan 2022 13:33:31 +0000 (13:33 +0000)
Platform wise, is not possible, as far as I known, to have Wayland
without kernel's DRM. Though, it's possible to configure
gstreamer-vaapi without DRM but Wayland support, with the enhanced
handling of dmabuf in vaapisink for Wayland, vaapisink will always
fail. Given both issues, configuration with no DRM but Wayland, makes
things more complex, and a simpler approach is to refuse that
configuration.

This patch disables Wayland support if there isn't DRM support. Also,
it disables the display test for Wayland, relying only on DRM and
X11.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1606>

subprojects/gstreamer-vaapi/gst/vaapi/gstvaapipluginutil.c
subprojects/gstreamer-vaapi/meson.build

index b98f305..0c47b75 100644 (file)
@@ -920,9 +920,6 @@ gst_vaapi_create_test_display (void)
 #if USE_DRM
     GST_VAAPI_DISPLAY_TYPE_DRM,
 #endif
-#if USE_WAYLAND
-    GST_VAAPI_DISPLAY_TYPE_WAYLAND,
-#endif
 #if USE_X11
     GST_VAAPI_DISPLAY_TYPE_X11,
 #endif
index 167a2bb..d16caec 100644 (file)
@@ -124,10 +124,14 @@ USE_AV1_DECODER = cc.has_header('va/va_dec_av1.h', dependencies: libva_dep, pref
 
 USE_DRM = libva_drm_dep.found() and libdrm_dep.found() and libudev_dep.found() and get_option('with_drm') != 'no'
 USE_EGL = gmodule_dep.found() and egl_dep.found() and GLES_VERSION_MASK != 0 and get_option('with_egl') != 'no'
-USE_WAYLAND = libva_wayland_dep.found() and wayland_client_dep.found() and wayland_protocols_dep.found() and wayland_scanner_bin.found() and get_option('with_wayland') != 'no'
+USE_WAYLAND = libva_wayland_dep.found() and wayland_client_dep.found() and wayland_protocols_dep.found() and wayland_scanner_bin.found() and get_option('with_wayland') != 'no' and USE_DRM
 USE_X11 = libva_x11_dep.found() and x11_dep.found() and get_option('with_x11') != 'no'
 USE_GLX = gl_dep.found() and libdl_dep.found() and get_option('with_glx') != 'no' and USE_X11
 
+if get_option('with_wayland') == 'yes' and not USE_DRM
+   error('DRM support is required to enable Wayland support')
+endif
+
 if not (USE_DRM or USE_X11 or USE_WAYLAND)
   error('No renderer API found (it is requried either DRM, X11 and/or WAYLAND)')
 endif