Skip to contentSkip to conversation

dma-buf/fence: fix fence_is_later v2

PATCH In review Alex Deucher 5 participants 5 messages Feb 29, 2016 – Mar 3, 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
Reviewed-by on v1 1/1
#1 lore raw

2016-02-29 Alex Deucher <[email protected]>:

Quoted 6 lines

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.

Quoted 7 lines
---
 include/linux/fence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

#2 lore raw

Op 29-02-16 om 23:13 schreef Gustavo Padovan:

Quoted 15 lines

2016-02-29 Alex Deucher <[email protected]>:

Quoted 6 lines

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.

Quoted 7 lines
---
 include/linux/fence.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 3 lines

Gustavo

Why is it causing overhead? Not really opposed to the patch though.
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

maintainer
#3 lore raw

Am 01.03.2016 um 09:36 schrieb Maarten Lankhorst:

Quoted 16 lines

Op 29-02-16 om 23:13 schreef Gustavo Padovan:

Quoted 15 lines

2016-02-29 Alex Deucher <[email protected]>:

Quoted 13 lines

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(-)
Quoted 4 lines
Quoted 3 lines

Gustavo

Why is it causing overhead? Not really opposed to the patch though.

We tested if flushing the VM is necessary by remembering the last flushed VM update operation and comparing that to what operation we need to have flushed for the current command submission to work.

So when we where already at the last operation in the timeline we would flush anyway which was superfluous.

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