Skip to contentSkip to conversation

dma-buf/fence: fix fence_is_later v2

PATCH New Alex Deucher 1 participant 1 message Feb 23, 2016 DMA buffer sharing framework

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dma-buf/fence: fix fence_is_later v2

From: Christian König <[email protected]>

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

v2: simplify check as suggested by Michel.

---
 include/linux/fence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/fence.h +1 -1
index bb52201..5aa95eb 100644
@@ -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;
 }
 
 /**
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel