derekf pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=72b1997f062e4749ea31515ae3c8253f79182838

commit 72b1997f062e4749ea31515ae3c8253f79182838
Author: Derek Foreman <der...@osg.samsung.com>
Date:   Tue May 17 13:42:32 2016 -0500

    evas: Add wayland dmabuf native surface type
    
    Add the structures required for supporting dmabuf native surfaces
---
 src/lib/evas/Evas_Legacy.h                         |  6 +++++
 .../engines/software_generic/evas_native_common.h  | 31 ++++++++++++++++++++++
 2 files changed, 37 insertions(+)

diff --git a/src/lib/evas/Evas_Legacy.h b/src/lib/evas/Evas_Legacy.h
index 24297eb..d5f9388 100644
--- a/src/lib/evas/Evas_Legacy.h
+++ b/src/lib/evas/Evas_Legacy.h
@@ -2560,6 +2560,7 @@ typedef enum _Evas_Native_Surface_Type
    EVAS_NATIVE_SURFACE_WL, /**< Wayland system based type. buffer of surface */
    EVAS_NATIVE_SURFACE_TBM, /**< Tizen system based type. tbm surface @since 
1.14  */
    EVAS_NATIVE_SURFACE_EVASGL, /**< Evas GL based type. evas gl surface @since 
1.14 */
+   EVAS_NATIVE_SURFACE_WL_DMABUF, /**< Wayland system based type. using dmabuf 
@since 1.18 */
 } Evas_Native_Surface_Type;
 
 /**
@@ -2614,6 +2615,11 @@ struct _Evas_Native_Surface
       } wl; /**< Set this struct fields if surface data is Wayland based. */
       struct
       {
+         void *attr; /**< Pointer to dmabuf attributes - contents copied */
+         void *resource; /**< Wayland resource pointer, kept as is */
+      } wl_dmabuf; /**< Set this struct fields if surface data is Wayland 
dmabuf based. @since 1.18 */
+      struct
+      {
          void *buffer; /**< tbm surface buffer to use @since 1.14 */
       } tbm; /**< Set this struct fields if surface data is Tizen based. 
@since 1.14 */
       struct
diff --git a/src/modules/evas/engines/software_generic/evas_native_common.h 
b/src/modules/evas/engines/software_generic/evas_native_common.h
index 0ea2b66..3b51b1a 100644
--- a/src/modules/evas/engines/software_generic/evas_native_common.h
+++ b/src/modules/evas/engines/software_generic/evas_native_common.h
@@ -29,6 +29,25 @@
 
 //#include <Evas_Common.h>
 
+struct dmabuf_attributes
+{
+  /* This must exactly match the struct in Enlightenment.
+   * Wayland dmabuf is still an experimental protocol and may
+   * change.  If the version doesn't match we won't even attempt
+   * to read the struct.
+   */
+   int version;
+   int32_t width;
+   int32_t height;
+   uint32_t format;
+   uint32_t flags; /* enum zlinux_buffer_params_flags */
+   int n_planes;
+   int fd[4];
+   uint32_t offset[4];
+   uint32_t stride[4];
+   uint64_t modifier[4];
+};
+
 typedef struct _Native Native;
 struct _Native
 {
@@ -54,6 +73,18 @@ struct _Native
          void                     *surface; /*egl surface*/
       } wl_surface; /**< Set this struct fields if surface data is Wayland 
based. */
 
+       /*  EVAS_NATIVE_SURFACE_WL_DMABUF */
+      struct
+      {
+         struct dmabuf_attributes attr; /* Plane attributes of buffer */
+         void                     *resource; /* Wayland resource for buffer */
+
+         // Run-time storage for bind/unbind
+         size_t                   size; /* size of are when mmapped */
+         void                     *ptr; /* data area when mmapped */
+         void                     *image; /* EGLImage when bound for GL */
+      } wl_surface_dmabuf; /**< Set this struct fields if surface data is 
Wayland dmabuf based. */
+
       /* EVAS_NATIVE_SURFACE_OPENGL */
       struct
       {

-- 


Reply via email to