From 83c2f3034934d1d671a7e8d372dbf7d08901fa8d Mon Sep 17 00:00:00 2001 From: Valentine Burley Date: Sat, 28 Sep 2024 11:08:42 +0000 Subject: [PATCH] egl: Fix missing libdrm check Guard the usage of DRM_PRIME_CAP_IMPORT and DRM_PRIME_CAP_EXPORT behind HAVE_LIBDRM. Fixes: c20d6a91971 ("egl: make dmabuf/modifier display bools a bit more precise/intelligible") Reviewed-by: Eric Engestrom Signed-off-by: Valentine Burley Part-of: --- src/egl/drivers/dri2/egl_dri2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index e3b361f0d29..0c8356a57d9 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -627,12 +627,14 @@ dri2_setup_screen(_EGLDisplay *disp) struct pipe_screen *pscreen = screen->base.screen; unsigned int api_mask = screen->api_mask; +#ifdef HAVE_LIBDRM int caps = dri_get_screen_param(dri2_dpy->dri_screen_render_gpu, PIPE_CAP_DMABUF); /* set if both import and export are suported */ if (dri2_dpy->multibuffers_available) { dri2_dpy->has_dmabuf_import = (caps & DRM_PRIME_CAP_IMPORT) > 0; dri2_dpy->has_dmabuf_export = (caps & DRM_PRIME_CAP_EXPORT) > 0; } +#endif #ifdef HAVE_ANDROID_PLATFORM dri2_dpy->has_native_fence_fd = dri_get_screen_param(dri2_dpy->dri_screen_render_gpu, PIPE_CAP_NATIVE_FENCE_FD); #endif