vc4: Fix context creation when syncobjs aren't supported.
authorEric Anholt <eric@anholt.net>
Mon, 6 Aug 2018 22:28:56 +0000 (15:28 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 7 Aug 2018 02:10:06 +0000 (19:10 -0700)
Noticed when trying to run current Mesa on rpi's downstream kernel.

Fixes: b0acc3a5628c ("broadcom/vc4: Native fence fd support")
src/gallium/drivers/vc4/vc4_fence.c

index 7071425595c4fc004d76534abd6041c76e8fe928..fac9df34d4fdc78a415189fdadb599338ec65ddd 100644 (file)
@@ -142,8 +142,12 @@ vc4_fence_context_init(struct vc4_context *vc4)
         /* Since we initialize the in_fence_fd to -1 (no wait necessary),
          * we also need to initialize our in_syncobj as signaled.
          */
-        return drmSyncobjCreate(vc4->fd, DRM_SYNCOBJ_CREATE_SIGNALED,
-                                &vc4->in_syncobj);
+        if (vc4->screen->has_syncobj) {
+                return drmSyncobjCreate(vc4->fd, DRM_SYNCOBJ_CREATE_SIGNALED,
+                                        &vc4->in_syncobj);
+        } else {
+                return 0;
+        }
 }
 
 void