software_generic: Check dmabuf attribute version during set
authorDerek Foreman <derekf@osg.samsung.com>
Thu, 29 Jun 2017 18:52:53 +0000 (13:52 -0500)
committerDerek Foreman <derekf@osg.samsung.com>
Thu, 29 Jun 2017 21:11:45 +0000 (16:11 -0500)
We should check here instead of only at time of usage.

src/modules/evas/engines/software_generic/evas_engine.c

index 05078fd..f58fb49 100644 (file)
@@ -1134,7 +1134,21 @@ eng_image_native_set(void *data EINA_UNUSED, void *image, void *native)
    RGBA_Image *im = image;
    Image_Entry *ie = image, *ie2;
 
-   if (!im) return NULL;
+   if (!im)
+     {
+        /* This is a probe for wl_dmabuf viability */
+        if (ns && ns->type == EVAS_NATIVE_SURFACE_WL_DMABUF &&
+            !ns->data.wl_dmabuf.resource)
+          {
+             struct dmabuf_attributes *attr;
+
+             attr = ns->data.wl_dmabuf.attr;
+             if (attr->version != EVAS_DMABUF_ATTRIBUTE_VERSION)
+               ns->data.wl_dmabuf.attr = NULL;
+          }
+
+        return NULL;
+     }
    if (!ns)
      {
         if (im->native.data && im->native.func.free)