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

git pushed a commit to branch devs/devilhorns/apos
in repository efl.

View the commit online.

commit c1202c70ab298ab9c61e0223a5bee98620132771
Author: Christopher Michael <devilho...@comcast.net>
AuthorDate: Wed Sep 3 08:57:50 2025 -0500

    ecore_drm2: Add support for doing framebuffers using
    drmModeAddFB2WithModifiers
    
    This won't really be entirely useful until drm2 supports dmabufs
---
 src/lib/ecore_drm2/ecore_drm2_fb.c | 26 ++++++++++++++++++++++----
 1 file changed, 22 insertions(+), 4 deletions(-)

diff --git a/src/lib/ecore_drm2/ecore_drm2_fb.c b/src/lib/ecore_drm2/ecore_drm2_fb.c
index 868736d68f..9a2053884a 100644
--- a/src/lib/ecore_drm2/ecore_drm2_fb.c
+++ b/src/lib/ecore_drm2/ecore_drm2_fb.c
@@ -2,13 +2,30 @@
 #include <gbm.h>
 
 static Eina_Bool
-_ecore_drm2_fb_add(Ecore_Drm2_Fb *fb)
+_ecore_drm2_fb_add(Ecore_Drm2_Fb *fb, Eina_Bool use_mods)
 {
    uint32_t offsets[4] = {0};
    int ret;
 
-   ret = sym_drmModeAddFB2(fb->fd, fb->w, fb->h, fb->format, fb->handles,
-			   fb->strides, offsets, &fb->id, 0);
+   if (use_mods && fb->modifier != DRM_FORMAT_MOD_INVALID)
+     {
+        uint64_t mods[4] = {};
+        size_t i = 0;
+
+        for (; i < EINA_C_ARRAY_LENGTH(mods) && fb->handles[i]; i++)
+          mods[i] = fb->modifier;
+
+        ret =
+          sym_drmModeAddFB2WithModifiers(fb->fd, fb->w, fb->h, fb->format,
+                                         fb->handles, fb->strides, offsets,
+                                         mods, &fb->id, DRM_MODE_FB_MODIFIERS);
+     }
+   else
+     {
+        ret = sym_drmModeAddFB2(fb->fd, fb->w, fb->h, fb->format, fb->handles,
+                                fb->strides, offsets, &fb->id, 0);
+     }
+
    if (ret) return EINA_FALSE;
    return EINA_TRUE;
 }
@@ -105,6 +122,7 @@ ecore_drm2_fb_create(Ecore_Drm2_Device *dev, int width, int height, int depth, i
 	fb->handles[0] = carg.handle;
 	fb->strides[0] = carg.pitch;
 	fb->sizes[0] = carg.size;
+        fb->modifier = DRM_FORMAT_MOD_INVALID;
      }
    else
      {
@@ -113,7 +131,7 @@ ecore_drm2_fb_create(Ecore_Drm2_Device *dev, int width, int height, int depth, i
 	fb->sizes[0] = fb->strides[0] * fb->h;
      }
 
-   if (!_ecore_drm2_fb_add(fb))
+   if (!_ecore_drm2_fb_add(fb, dev->gbm_mods))
      {
 	ret =
 	  sym_drmModeAddFB(dev->fd, width, height, depth, bpp,

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

Reply via email to