[Intel-gfx] [PATCH 4/9] android/sync: hack: enable fence signaling in Android Native Sync implementation

Jesse Barnes jbarnes at virtuousgeek.org
Fri Sep 4 09:58:58 PDT 2015


---
 drivers/staging/android/sync.c | 29 +++++++++++++++++------------
 1 file changed, 17 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/android/sync.c b/drivers/staging/android/sync.c
index 7f0e919..858278d 100644
--- a/drivers/staging/android/sync.c
+++ b/drivers/staging/android/sync.c
@@ -384,24 +384,29 @@ int sync_fence_wait(struct sync_fence *fence, long timeout)
 		timeout = msecs_to_jiffies(timeout);
 
 	trace_sync_wait(fence, 1);
-	for (i = 0; i < fence->num_fences; ++i)
+	for (i = 0; i < fence->num_fences; ++i) {
 		trace_sync_pt(fence->cbs[i].sync_pt);
+		ret = fence_wait_timeout(fence->cbs[i].sync_pt, true, timeout);
+		if (ret < 0) {
+			trace_sync_wait(fence, 0);
+			return ret;
+		} else if (ret == 0) {
+			trace_sync_wait(fence, 0);
+			if (timeout) {
+				pr_info("fence timeout on [%p] after %dms\n",
+					fence, jiffies_to_msecs(timeout));
+				sync_dump();
+			}
+			return -ETIME;
+		}
+	}
+#if 0
 	ret = wait_event_interruptible_timeout(fence->wq,
 					       atomic_read(&fence->status) <= 0,
 					       timeout);
+#endif
 	trace_sync_wait(fence, 0);
 
-	if (ret < 0) {
-		return ret;
-	} else if (ret == 0) {
-		if (timeout) {
-			pr_info("fence timeout on [%p] after %dms\n", fence,
-				jiffies_to_msecs(timeout));
-			sync_dump();
-		}
-		return -ETIME;
-	}
-
 	ret = atomic_read(&fence->status);
 	if (ret) {
 		pr_info("fence error %ld on [%p]\n", ret, fence);
-- 
1.9.1



More information about the Intel-gfx mailing list