libs: egl: surface: export EGLImage as DMABuf if GEM not supported
authorVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Tue, 9 Jul 2019 17:17:48 +0000 (19:17 +0200)
committerVíctor Manuel Jáquez Leal <vjaquez@igalia.com>
Fri, 14 Aug 2020 10:43:20 +0000 (12:43 +0200)
commit7a3b25884c0837cfbd8cd9bd72108fc77a5e6773
tree918ae279e7911d52a9d5a8850fb9598900d5b262
parent992d9e3a20662b11654ac37e46419c363d49bce9
libs: egl: surface: export EGLImage as DMABuf if GEM not supported

This code path is used when frames are rendered as textures through
GstVideoGLTextureUploadMeta with EGL, mainly under Wayland.

Originally the EGLImage was exported as GEM, which was handled by
Intel drivers, but Gallium ones cannot create VA surfaces from
GEM buffers, only DMABuf.

This patch checks the memory types supported by VA driver to choose
the render the EGLImages from GEM or DMABuf, because GEM is still
better where supported.

DMABuf is well handled either by intel-vaapi-driver and gallium.

Fixes: #137
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/122>
gst-libs/gst/vaapi/egl_vtable.h
gst-libs/gst/vaapi/gstvaapisurface_egl.c
gst-libs/gst/vaapi/gstvaapisurface_egl.h
gst-libs/gst/vaapi/gstvaapitexture_egl.c