All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Revert "dma-buf/sync-file: Avoid enable fence signaling if poll(.timeout=0)"
@ 2016-11-18  8:26 Gustavo Padovan
  2016-11-18  8:56 ` Chris Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Gustavo Padovan @ 2016-11-18  8:26 UTC (permalink / raw)
  To: dri-devel; +Cc: Gustavo Padovan

From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

This reverts commit ecebca79f6976ddaddfd054d699272515869ea28.

Do not enable fence callback on poll() when using fence_array causes the
fence_array to not signal.

For now we will revert the change and enable signaling everytime time
poll is called with timeout=0 as well.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
---
 drivers/dma-buf/sync_file.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index 69d8ef9..6d802f2 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -308,8 +308,7 @@ static unsigned int sync_file_poll(struct file *file, poll_table *wait)
 
 	poll_wait(file, &sync_file->wq, wait);
 
-	if (!poll_does_not_wait(wait) &&
-	    !test_and_set_bit(POLL_ENABLED, &sync_file->fence->flags)) {
+	if (!test_and_set_bit(POLL_ENABLED, &sync_file->fence->flags)) {
 		if (dma_fence_add_callback(sync_file->fence, &sync_file->cb,
 					   fence_check_cb_func) < 0)
 			wake_up_all(&sync_file->wq);
-- 
2.5.5

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Revert "dma-buf/sync-file: Avoid enable fence signaling if poll(.timeout=0)"
  2016-11-18  8:26 [PATCH v2] Revert "dma-buf/sync-file: Avoid enable fence signaling if poll(.timeout=0)" Gustavo Padovan
@ 2016-11-18  8:56 ` Chris Wilson
  2016-11-18  9:37   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2016-11-18  8:56 UTC (permalink / raw)
  To: Gustavo Padovan; +Cc: Gustavo Padovan, dri-devel

On Fri, Nov 18, 2016 at 05:26:43PM +0900, Gustavo Padovan wrote:
> From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> This reverts commit ecebca79f6976ddaddfd054d699272515869ea28.
> 
> Do not enable fence callback on poll() when using fence_array causes the
> fence_array to not signal.
> 
> For now we will revert the change and enable signaling everytime time
> poll is called with timeout=0 as well.
> 
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>

Acked-by: Chris Wilson <chris@chris-wilson.co.uk>

I have some patches to use a bit on fence_array->flags to indicate where
we can use this shortcut. I'm hoping someone has a better idea.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] Revert "dma-buf/sync-file: Avoid enable fence signaling if poll(.timeout=0)"
  2016-11-18  8:56 ` Chris Wilson
@ 2016-11-18  9:37   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2016-11-18  9:37 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Gustavo Padovan, dri-devel

On Fri, Nov 18, 2016 at 08:56:11AM +0000, Chris Wilson wrote:
> On Fri, Nov 18, 2016 at 05:26:43PM +0900, Gustavo Padovan wrote:
> > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > 
> > This reverts commit ecebca79f6976ddaddfd054d699272515869ea28.
> > 
> > Do not enable fence callback on poll() when using fence_array causes the
> > fence_array to not signal.
> > 
> > For now we will revert the change and enable signaling everytime time
> > poll is called with timeout=0 as well.
> > 
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> 
> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>

Applied to drm-misc.

> I have some patches to use a bit on fence_array->flags to indicate where
> we can use this shortcut. I'm hoping someone has a better idea.

Fundamentally this is a property of how the fence is implemented. A flag
indicating that this fence will eventually signal, even when
enable_signalling isn't called seems like a perfectly ok approach.

We might want to spell out the different expectations clearly though, i.e.
if you block on a fence you must still call ->enable_signalling for prompt
signalling (and maybe it's needed to handle blocking waits or whatever).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-18  9:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-18  8:26 [PATCH v2] Revert "dma-buf/sync-file: Avoid enable fence signaling if poll(.timeout=0)" Gustavo Padovan
2016-11-18  8:56 ` Chris Wilson
2016-11-18  9:37   ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.