This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch devs/cedric/wl/gl-x11-dmabuf
in repository efl.

View the commit online.

commit 1946c5e0658e0330248424672491aeb286c081ad
Author: Cedric BAIL <[email protected]>
AuthorDate: Sat Nov 28 22:55:57 2026 -0600

    evas:wayland_egl: import wl_dmabuf native surfaces
    
    wayland_egl did not handle EVAS_NATIVE_SURFACE_WL_DMABUF, so a
    compositor nested in another one cannot take GPU buffers from its
    clients: the probe Enlightenment makes before it accepts a buffer fails
    for every one of them. Use the import gl_common shares with gl_drm and
    gl_x11, including that probe.
    
    As in gl_x11 it is built for GL_GLES only, and does not use the
    EVAS_NATIVE_SURFACE_WL code next to it, which depends on HAVE_WAYLAND.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/modules/evas/engines/wayland_egl/evas_engine.c | 42 ++++++++++++++++++++--
 1 file changed, 40 insertions(+), 2 deletions(-)

diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 3bed36ebe0..5514c32ae1 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -56,6 +56,9 @@ Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_relax = NULL;
 void * (*glsym_eglGetProcAddress) (const char *a) = NULL;
 EGLImageKHR (*glsym_evas_gl_common_eglCreateImage)(EGLDisplay a, EGLContext b, EGLenum c, EGLClientBuffer d, const EGLAttrib *e) = NULL;
 int (*glsym_evas_gl_common_eglDestroyImage) (EGLDisplay a, void *b) = NULL;
+Evas_GL_Image *(*glsym_evas_gl_common_dmabuf_test_image_new) (Evas_Engine_GL_Context *a, const Evas_Native_Surface *b, EGLDisplay c) = NULL;
+Evas_GL_Image *(*glsym_evas_gl_common_dmabuf_native_lookup) (Evas_Engine_GL_Context *a, Evas_GL_Image *b, const Evas_Native_Surface *c) = NULL;
+Eina_Bool (*glsym_evas_gl_common_dmabuf_native_attach) (Evas_Engine_GL_Context *a, Evas_GL_Image *b, const Evas_Native_Surface *c, EGLDisplay d) = NULL;
 void (*glsym_glEGLImageTargetTexture2DOES) (int a, void *b)  = NULL;
 unsigned int (*glsym_eglSwapBuffersWithDamage) (EGLDisplay a, void *b, const EGLint *d, EGLint c) = NULL;
 unsigned int (*glsym_eglSetDamageRegionKHR) (EGLDisplay a, EGLSurface b, EGLint *c, EGLint d) = NULL;
@@ -122,6 +125,9 @@ symbols(void)
    LINK2GENERIC(eglGetProcAddress);
    LINK2GENERIC(evas_gl_common_eglCreateImage);
    LINK2GENERIC(evas_gl_common_eglDestroyImage);
+   LINK2GENERIC(evas_gl_common_dmabuf_test_image_new);
+   LINK2GENERIC(evas_gl_common_dmabuf_native_lookup);
+   LINK2GENERIC(evas_gl_common_dmabuf_native_attach);
 
    done = EINA_TRUE;
 }
@@ -1009,6 +1015,15 @@ eng_image_native_set(void *engine, void *image, void *native)
                                                         NULL, 1,
                                                         EVAS_COLORSPACE_ARGB8888);
           }
+#ifdef GL_GLES
+        else if ((ns) && (ns->type == EVAS_NATIVE_SURFACE_WL_DMABUF) &&
+                 (!ns->data.wl_dmabuf.resource) &&
+                 (glsym_evas_gl_common_dmabuf_test_image_new))
+          {
+             return glsym_evas_gl_common_dmabuf_test_image_new(ob->gl_context,
+                                                               ns, ob->egl_disp);
+          }
+#endif
         else
           return NULL;
      }
@@ -1072,7 +1087,18 @@ eng_image_native_set(void *engine, void *image, void *native)
      }
 
 
-   if (ns->type == EVAS_NATIVE_SURFACE_WL)
+   if (ns->type == EVAS_NATIVE_SURFACE_WL_DMABUF)
+     {
+#ifdef GL_GLES
+        if (glsym_evas_gl_common_dmabuf_native_lookup)
+          {
+             img2 = glsym_evas_gl_common_dmabuf_native_lookup(ob->gl_context,
+                                                              img, ns);
+             if (img2) return img2;
+          }
+#endif
+     }
+   else if (ns->type == EVAS_NATIVE_SURFACE_WL)
      {
         wlid = wl_buf;
         img2 = eina_hash_find(ob->gl_context->shared->native_wl_hash, &wlid);
@@ -1140,7 +1166,19 @@ eng_image_native_set(void *engine, void *image, void *native)
 
    if (!(img = img2)) return NULL;
 
-   if (ns->type == EVAS_NATIVE_SURFACE_WL)
+   if (ns->type == EVAS_NATIVE_SURFACE_WL_DMABUF)
+     {
+#ifdef GL_GLES
+        if ((!glsym_evas_gl_common_dmabuf_native_attach) ||
+            (!glsym_evas_gl_common_dmabuf_native_attach(ob->gl_context, img,
+                                                        ns, ob->egl_disp)))
+          {
+             glsym_evas_gl_common_image_free(img);
+             return NULL;
+          }
+#endif
+     }
+   else if (ns->type == EVAS_NATIVE_SURFACE_WL)
      {
         if (native)
           {

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to