dma-buf/fence: fix fence_is_later v2
authorChristian König <christian.koenig@amd.com>
Mon, 29 Feb 2016 15:53:11 +0000 (10:53 -0500)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 21 Mar 2016 08:26:50 +0000 (09:26 +0100)
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@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
include/linux/fence.h

index bb522011383bca52ba248110a2a4c1e86d1f5aa3..5aa95eb886f74c3e24dc8568da8a81aea591066e 100644 (file)
@@ -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;
 }
 
 /**