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

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

View the commit online.

commit 8aa1c0bd6ca3fba890f6832b207e1d472c024657
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Nov 15 18:40:14 2026 -0600

    evas:gl_x11: import wl_dmabuf native surfaces
    
    gl_x11 did not handle EVAS_NATIVE_SURFACE_WL_DMABUF, so the image was
    left in error. That is why Enlightenment's wl_x11 backend turns dmabuf
    off: Chromium and every other client with a GPU process falls back to
    wl_shm there, and each frame is rendered on the CPU and copied. Use the
    import that gl_common shares with gl_drm, so a compositor on gl_x11 can
    offer zwp_linux_dmabuf_v1.
    
    This includes the probe for a surface with attributes but no resource,
    which is what a compositor asks before it accepts dmabufs at all.
    
    Like gl_drm, it is built for GL_GLES only. It does not use the
    EVAS_NATIVE_SURFACE_WL code next to it, which depends on HAVE_WAYLAND
    and is not built since nothing defines it.
    
    Co-Authored-By: Claude Opus 5 <[email protected]>
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/modules/evas/engines/gl_x11/evas_engine.c | 40 +++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index 8926c6afea..2b9dbe2519 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -76,6 +76,9 @@ glsym_func_void_ptr      glsym_evas_gl_common_current_context_get = 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;
@@ -1362,6 +1365,9 @@ eng_gl_symbols(Outbuf *ob)
 
    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);
 
    FINDSYM(glsym_eglSwapBuffersWithDamage, "eglSwapBuffersWithDamage", NULL);
    FINDSYM(glsym_eglSwapBuffersWithDamage, "eglSwapBuffersWithDamageEXT", "EGL_EXT_swap_buffers_with_damage");
@@ -2331,6 +2337,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(gl_context, ns,
+                                                             ob->egl_disp);
+         }
+#endif
        else
          return NULL;
     }
@@ -2467,6 +2482,16 @@ eng_image_native_set(void *engine, void *image, void *native)
               }
          }
     }
+  else if (ns->type == EVAS_NATIVE_SURFACE_WL_DMABUF)
+     {
+#ifdef GL_GLES
+        if (glsym_evas_gl_common_dmabuf_native_lookup)
+          {
+             im2 = glsym_evas_gl_common_dmabuf_native_lookup(gl_context, im, ns);
+             if (im2) return im2;
+          }
+#endif
+     }
   else if (ns->type == EVAS_NATIVE_SURFACE_WL)
      {
 #ifdef GL_GLES
@@ -2908,6 +2933,21 @@ eng_image_native_set(void *engine, void *image, void *native)
               }
          }
     }
+   else if (ns->type == EVAS_NATIVE_SURFACE_WL_DMABUF)
+     {
+#ifdef GL_GLES
+        if (native)
+          {
+             if ((!glsym_evas_gl_common_dmabuf_native_attach) ||
+                 (!glsym_evas_gl_common_dmabuf_native_attach(gl_context, im, ns,
+                                                             ob->egl_disp)))
+               {
+                  glsym_evas_gl_common_image_free(im);
+                  return NULL;
+               }
+          }
+#endif
+     }
    else if (ns->type == EVAS_NATIVE_SURFACE_WL)
      {
 #ifdef GL_GLES

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

Reply via email to