[PATCH] dma-buf/fence: fix fence_is_later v2

Alex Deucher alexdeucher at gmail.com
Mon Feb 22 19:32:55 UTC 2016


From: Christian König <christian.koenig at amd.com>

A fence is never later than itself. This caused a bunch of overhead for AMDGPU.

v2: simplify check as suggested by Michel.

Signed-off-by: Christian König <christian.koenig at amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
 include/linux/fence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/fence.h b/include/linux/fence.h
index bb52201..5aa95eb 100644
--- a/include/linux/fence.h
+++ b/include/linux/fence.h
@@ -292,7 +292,7 @@ static inline bool fence_is_later(struct fence *f1, struct fence *f2)
 	if (WARN_ON(f1->context != f2->context))
 		return false;
 
-	return f1->seqno - f2->seqno < INT_MAX;
+	return (int)(f1->seqno - f2->seqno) > 0;
 }
 
 /**
-- 
2.5.0



More information about the dri-devel mailing list