egl: decouple dmabuf import/export cap from xserver support

multibuffers_available denotes xserver side support for
DRI3 and Present protocols which should not affect client
side support for dmabuf import/export.

This is for xserver with amdgpu DDX in which case
multibuffers_available will be false, but dmabuf import/export
should be enabled to support applications like mpv which use
dmabuf import for vaapi decoded buffer.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31657>
This commit is contained in:
Qiang Yu 2024-10-15 10:48:16 +08:00 committed by Marge Bot
parent 607686f6bf
commit 354dc800d2

View file

@ -629,11 +629,8 @@ dri2_setup_screen(_EGLDisplay *disp)
#ifdef HAVE_LIBDRM
unsigned caps = pscreen->caps.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;
}
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 = pscreen->caps.native_fence_fd;