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

git pushed a commit to reference refs/pull/231/head
in repository enlightenment.

View the commit online.

commit 736fe4509e38dac128a0a273a669ac80a0b6c3f1
Author: Cedric BAIL <[email protected]>
AuthorDate: Sun Nov 29 20:29:27 2026 -0600

    e_comp_wl - offer dmabuf when it can be imported, not per backend
    
    dmabuf was switched off for the X11 backend in 2016 (da23b852e) as "too
    hard to get right and nobody will notice its absence". Nobody did, then:
    clients drew with the CPU and handed over shm. Browsers render on the GPU
    now and reach for dmabuf first, so on the backend a person is most likely
    to be developing against, the absence is the difference between
    compositing on the GPU and copying every frame through main memory.
    
    But lifting the flag on its own is wrong, and finding out why explains
    the original commit. A backend does not know whether import works. Asked
    directly, E's Evas_GL api on this machine's X11 canvas has
    evasglQueryDmaBufFormats, evasglQueryDmaBufModifiers and
    evasglBindWaylandDisplay all NULL, while e_comp_gl_get() still reports
    GL - so E would advertise dmabuf, fall back to the two hardcoded formats
    in e_pixmap_dmabuf_formats_query because the engine cannot answer, and
    then have nothing to turn a client's buffer into. A client that sees the
    global uses it in preference to the shm path that would have worked.
    Advertising an import path that does not exist is worse than staying
    quiet, and that is a fair description of "too hard to get right".
    
    So the decision moves to what knows the answer. linux_dmabuf_setup() now
    asks whether an import is possible at all and creates no global if it is
    not, and the X11 backend no longer refuses on the backend's behalf. Where
    the engine can import, dmabuf appears - including version 4 when the
    device is known. Where it cannot, nothing is advertised, which is what
    happened before by a less honest route.
    
    What was hard in 2016 was most likely buffer lifetime rather than
    import: an imported dmabuf is a texture the renderer may still be
    reading when the client wants its buffer back. e_pixmap now holds each
    buffer until the renderer is done with it, and e_pixmap_dmabuf_test()
    still refuses a layout the engine cannot take, one buffer at a time.
    
    No change to the wl_buffer and wl_wl flags: the first is a backend with
    no GL at all and the second proxies to a host compositor, and neither
    question is the one this predicate answers.
    
    Co-Authored-By: Claude Opus 5.5 <[email protected]>
---
 src/bin/e_comp_wl.c             | 15 +++++++++++++++
 src/bin/e_comp_wl_dmabuf.c      |  5 +++++
 src/modules/wl_x11/e_mod_main.c |  2 --
 3 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/src/bin/e_comp_wl.c b/src/bin/e_comp_wl.c
index e5f057af7..4641493cc 100644
--- a/src/bin/e_comp_wl.c
+++ b/src/bin/e_comp_wl.c
@@ -3800,6 +3800,21 @@ e_comp_wl_query_dmabuf_modifiers(int format, int max_modifiers, uint64_t *modifi
 #endif
 }
 
+/* Whether E can import a client's dmabuf at all. The backend does not know:
+ * on a canvas whose EGL never resolved the wayland extensions, these entries
+ * are all NULL while e_comp_gl_get() still reports GL. */
+Eina_Bool
+e_comp_wl_dmabuf_importable(void)
+{
+#if EVAS_GL_API_VERSION >= 7
+   if (!e_comp_wl->wl.glapi) return EINA_FALSE;
+   if (!e_comp_wl->wl.glapi->evasglQueryDmaBufFormats) return EINA_FALSE;
+   return !!e_comp_wl->wl.glapi->evasglQueryDmaBufModifiers;
+#else
+   return EINA_FALSE;
+#endif
+}
+
 /* The DRM node E imports dmabufs on, as a dev_t widened to a fixed size.
  *
  * This is what zwp_linux_dmabuf_v1 version 4 calls the main device, and it is
diff --git a/src/bin/e_comp_wl_dmabuf.c b/src/bin/e_comp_wl_dmabuf.c
index 2ffee828e..cd4c215d1 100644
--- a/src/bin/e_comp_wl_dmabuf.c
+++ b/src/bin/e_comp_wl_dmabuf.c
@@ -49,6 +49,7 @@
 /* Defined in e_comp_wl.c, which is where the Evas_GL handle lives. Declared
  * here rather than in a header for the same reason e_pixmap.c declares its two
  * siblings that way: they are one wire between two files in the same binary. */
+extern Eina_Bool e_comp_wl_dmabuf_importable(void);
 extern Eina_Bool e_comp_wl_query_dmabuf_device(uint64_t *device);
 
 void
@@ -868,6 +869,10 @@ linux_dmabuf_setup(struct wl_display *display)
 {
    int version = 3;
 
+   /* A client that sees the global prefers it to shm, so offering an import
+    * path that does not exist would leave its buffers with nowhere to go. */
+   if (!e_comp_wl_dmabuf_importable()) return 0;
+
    /* Version 4 is offered only if both halves of a feedback answer can be
     * had: the device E imports on, and a format table to point at. Neither is
     * something to guess.
diff --git a/src/modules/wl_x11/e_mod_main.c b/src/modules/wl_x11/e_mod_main.c
index 87835944f..d73d7fd49 100644
--- a/src/modules/wl_x11/e_mod_main.c
+++ b/src/modules/wl_x11/e_mod_main.c
@@ -69,8 +69,6 @@ e_modapi_init(E_Module *m)
    e_comp->pointer = e_pointer_canvas_new(e_comp->ee, EINA_TRUE);
    e_comp->pointer->color = EINA_TRUE;
 
-   e_comp_wl->dmabuf_disable = EINA_TRUE;
-
    return m;
 }
 

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

Reply via email to