[mutter] wayland/buffer: Try realizing EGLStream before EGLImage buffer



commit 056c45fe0c70fb09c2f0281dc6748f142bcdc033
Author: Erik Kurzinger <ekurzinger nvidia com>
Date:   Tue Mar 5 23:39:15 2019 +0000

    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

 src/wayland/meta-wayland-buffer.c | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/src/wayland/meta-wayland-buffer.c b/src/wayland/meta-wayland-buffer.c
index ac2eb98b7..f45679d3a 100644
--- a/src/wayland/meta-wayland-buffer.c
+++ b/src/wayland/meta-wayland-buffer.c
@@ -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)
     {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]