[Mesa-dev] [PATCH 10/13] i965/sync: Fold brw_fence_has_completed() into caller

Chad Versace chad.versace at intel.com
Sat Jul 9 00:01:00 UTC 2016


The function is tiny and called exactly once. There's no need for it to
exist.
---
 src/mesa/drivers/dri/i965/intel_syncobj.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_syncobj.c b/src/mesa/drivers/dri/i965/intel_syncobj.c
index 8a18016..8132efa 100644
--- a/src/mesa/drivers/dri/i965/intel_syncobj.c
+++ b/src/mesa/drivers/dri/i965/intel_syncobj.c
@@ -72,13 +72,6 @@ brw_fence_insert(struct brw_context *brw, struct brw_fence *fence)
    intel_batchbuffer_flush(brw);
 }
 
-static bool
-brw_fence_has_completed(struct brw_fence *fence)
-{
-   assert(fence->batch_bo);
-   return !drm_intel_bo_busy(fence->batch_bo);
-}
-
 /**
  * Return true if the function successfully signals or has already signalled.
  * (This matches the behavior expected from __DRI2fence::client_wait_sync).
@@ -166,8 +159,11 @@ static void
 intel_gl_check_sync(struct gl_context *ctx, struct gl_sync_object *s)
 {
    struct intel_gl_sync_object *sync = (struct intel_gl_sync_object *)s;
+   struct brw_fence *fence = &sync->fence;
 
-   if (brw_fence_has_completed(&sync->fence))
+   assert(fence->batch_bo);
+
+   if (!drm_intel_bo_busy(fence->batch_bo))
       s->StatusFlag = 1;
 }
 
-- 
2.9.0.rc2



More information about the mesa-dev mailing list