wayland/buffer: Try realizing EGLStream before EGLImage buffer

Currently, it is assumed that if querying the EGL_TEXTURE_FORMAT of a
Wayland buffer succeeds it is an EGLImage. However, this assumption will no
longer hold on upcoming versions of the NVIDIA EGL Wayland driver which
will include support for querying this attribute for EGLStream buffers as
well. Hence, we need to check if buffers are EGLStreams first.

Fixes #488
https://gitlab.gnome.org/GNOME/mutter/merge_requests/477
This commit is contained in:
Erik Kurzinger 2019-03-05 23:39:15 +00:00
parent 2ac7f7f1e5
commit 056c45fe0c

View File

@ -119,14 +119,6 @@ meta_wayland_buffer_realize (MetaWaylandBuffer *buffer)
return TRUE;
}
if (meta_egl_query_wayland_buffer (egl, egl_display, buffer->resource,
EGL_TEXTURE_FORMAT, &format,
NULL))
{
buffer->type = META_WAYLAND_BUFFER_TYPE_EGL_IMAGE;
return TRUE;
}
#ifdef HAVE_WAYLAND_EGLSTREAM
stream = meta_wayland_egl_stream_new (buffer, NULL);
if (stream)
@ -146,6 +138,14 @@ meta_wayland_buffer_realize (MetaWaylandBuffer *buffer)
}
#endif /* HAVE_WAYLAND_EGLSTREAM */
if (meta_egl_query_wayland_buffer (egl, egl_display, buffer->resource,
EGL_TEXTURE_FORMAT, &format,
NULL))
{
buffer->type = META_WAYLAND_BUFFER_TYPE_EGL_IMAGE;
return TRUE;
}
dma_buf = meta_wayland_dma_buf_from_buffer (buffer);
if (dma_buf)
{