dmabuf: Make a define for the version of the dmabuf attribute struct
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 29 Jun 2017 18:51:07 +0000 (13:51 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Thu, 29 Jun 2017 18:51:07 +0000 (13:51 -0500)
I should've done this in the first place, and the version checks are
starting to spread out a bit.

src/modules/evas/engines/gl_drm/evas_engine.c
src/modules/evas/engines/software_generic/evas_native_common.h
src/modules/evas/engines/software_generic/evas_native_dmabuf.c

index b1083a1..fe69ef0 100644 (file)
@@ -1320,7 +1320,7 @@ eng_image_native_set(void *engine, void *image, void *native)
              struct dmabuf_attributes *a;
 
              a = ns->data.wl_dmabuf.attr;
-             if (a->version != 1)
+             if (a->version != EVAS_DMABUF_ATTRIBUTE_VERSION)
                {
                   glsym_evas_gl_common_image_free(img);
                   return NULL;
index a3b721d..de35335 100644 (file)
@@ -29,6 +29,8 @@
 
 //#include <Evas_Common.h>
 
+#define EVAS_DMABUF_ATTRIBUTE_VERSION 1
+
 struct dmabuf_attributes
 {
   /* This must exactly match the struct in Enlightenment.
index f01a6c4..bd88850 100644 (file)
@@ -107,7 +107,7 @@ _evas_native_dmabuf_surface_image_set(void *image, void *native)
         if (!n) return NULL;
 
         a = ns->data.wl_dmabuf.attr;
-        if (a->version != 1)
+        if (a->version != EVAS_DMABUF_ATTRIBUTE_VERSION)
           {
              free(n);
              return NULL;