From a6a8a136087f674cde1e64022b75ff2a773846e4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Sun, 30 Jan 2022 09:38:48 +0100 Subject: [PATCH] vaapi: Disable Wayland if no libdrm 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: --- subprojects/gstreamer-vaapi/gst/vaapi/gstvaapipluginutil.c | 3 --- subprojects/gstreamer-vaapi/meson.build | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/subprojects/gstreamer-vaapi/gst/vaapi/gstvaapipluginutil.c b/subprojects/gstreamer-vaapi/gst/vaapi/gstvaapipluginutil.c index b98f305..0c47b75 100644 --- a/subprojects/gstreamer-vaapi/gst/vaapi/gstvaapipluginutil.c +++ b/subprojects/gstreamer-vaapi/gst/vaapi/gstvaapipluginutil.c @@ -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 diff --git a/subprojects/gstreamer-vaapi/meson.build b/subprojects/gstreamer-vaapi/meson.build index 167a2bb..d16caec 100644 --- a/subprojects/gstreamer-vaapi/meson.build +++ b/subprojects/gstreamer-vaapi/meson.build @@ -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 -- 2.7.4