derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=4258fa4f70b88a014efd42a503a8b825693428ea

commit 4258fa4f70b88a014efd42a503a8b825693428ea
Author: Derek Foreman <[email protected]>
Date:   Tue Dec 6 10:43:18 2016 -0600

    gl_drm: Allow testing of dmabuf objects
    
    Enlightenment needs to know if a specific dmabuf format is supported
    before it lets clients use it.  This lets E test commit a wayland
    dmabuf object without assigning it a buffer.
---
 src/modules/evas/engines/gl_drm/evas_engine.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c 
b/src/modules/evas/engines/gl_drm/evas_engine.c
index 12889a3..0b37659 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.c
+++ b/src/modules/evas/engines/gl_drm/evas_engine.c
@@ -1177,6 +1177,23 @@ eng_image_native_set(void *data, void *image, void 
*native)
                                                         NULL, 1,
                                                         
EVAS_COLORSPACE_ARGB8888);
           }
+        else if ((ns) && (ns->type == EVAS_NATIVE_SURFACE_WL_DMABUF))
+          {
+             if (!ns->data.wl_dmabuf.resource)
+               {
+                  struct dmabuf_attributes *attr;
+                  void *v;
+
+                  attr = ns->data.wl_dmabuf.attr;
+                  v = import_simple_dmabuf(ob->egl.disp, attr);
+                  if (!v) {
+                       ns->data.wl_dmabuf.attr = NULL;
+                       return NULL;
+                    }
+                  glsym_eglDestroyImage(ob->egl.disp, v);
+                  return NULL;
+               }
+          }
         else
           return NULL;
      }

-- 


Reply via email to