i915g: implement fence signalling
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 7 Jun 2011 20:22:16 +0000 (22:22 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sat, 11 Jun 2011 15:11:26 +0000 (17:11 +0200)
v2: Incorporated feedback from Jakob Bornecrantz.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
src/gallium/winsys/i915/drm/i915_drm_fence.c

index 30ebf4835eaff4bafe095dbbb1c5ac718664586d..650ccfcd8767840a600daa51002f2741df7550bf 100644 (file)
@@ -52,9 +52,13 @@ static int
 i915_drm_fence_signalled(struct i915_winsys *iws,
                           struct pipe_fence_handle *fence)
 {
-   assert(0);
+   struct i915_drm_fence *f = (struct i915_drm_fence *)fence;
 
-   return 0;
+   /* fence already expired */
+   if (!f->bo)
+          return 1;
+
+   return !drm_intel_bo_busy(f->bo);
 }
 
 static int