egl: Fix missing libdrm check

Guard the usage of DRM_PRIME_CAP_IMPORT and DRM_PRIME_CAP_EXPORT behind HAVE_LIBDRM.

Fixes: c20d6a9197 ("egl: make dmabuf/modifier display bools a bit more precise/intelligible")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: Valentine Burley <valentine.burley@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31430>
This commit is contained in:
Valentine Burley 2024-09-28 11:08:42 +00:00
parent a74ebffc6a
commit 83c2f30349

View File

@ -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