From: Chris Wilson <chris@chris-wilson.co.uk>
To: Gustavo Padovan <gustavo@padovan.org>,
dri-devel@lists.freedesktop.org, marcheu@google.com,
Daniel Stone <daniels@collabora.com>,
seanpaul@google.com, Daniel Vetter <daniel.vetter@ffwll.ch>,
linux-kernel@vger.kernel.org, laurent.pinchart@ideasonboard.com,
Gustavo Padovan <gustavo.padovan@collabora.co.uk>,
John Harrison <John.C.Harrison@Intel.com>,
m.chehab@samsung.com
Subject: Re: [PATCH v5 5/5] dma-buf/sync_file: only enable fence signalling on poll()
Date: Fri, 5 Aug 2016 08:42:16 +0100 [thread overview]
Message-ID: <20160805074216.GG12034@nuc-i3427.alporthouse.com> (raw)
In-Reply-To: <20160805072815.GE12034@nuc-i3427.alporthouse.com>
On Fri, Aug 05, 2016 at 08:28:15AM +0100, Chris Wilson wrote:
> On Thu, Aug 04, 2016 at 11:24:14PM -0300, Gustavo Padovan wrote:
> > From: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> >
> > Signalling doesn't need to be enabled at sync_file creation, it is only
> > required if userspace waiting the fence to signal through poll().
> >
> > Thus we delay fence_add_callback() until poll is called. It only adds the
> > callback the first time poll() is called. This avoid re-adding the same
> > callback multiple times.
> >
> > v2: rebase and update to work with new fence support for sync_file
> >
> > v3: use atomic operation to set enabled and protect fence_add_callback()
> >
> > v4: use user bit from fence flags (comment from Chris Wilson)
> >
> > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> > ---
> > + if (!test_and_set_bit(POLL_ENABLED, &sync_file->fence->flags)) {
> > + if (fence_add_callback(sync_file->fence, &sync_file->cb,
> > + fence_check_cb_func) < 0)
> > + wake_up_all(&sync_file->wq);
> > + }
> > +
> > status = fence_is_signaled(sync_file->fence);
>
> status can only be true/false here.
> return fence_is_signaled(sync_file->fence) ? POLLIN : 0;
>
> Reviwed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by
/me goes back to drinking his coffee
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
prev parent reply other threads:[~2016-08-05 7:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 2:24 [PATCH v5 1/5] dma-buf/fence-array: add fence_is_array() Gustavo Padovan
2016-08-05 2:24 ` [PATCH v5 2/5] dma-buf/sync_file: refactor fence storage in struct sync_file Gustavo Padovan
2016-08-05 2:24 ` [PATCH v5 3/5] dma-buf/sync_file: add sync_file_get_fence() Gustavo Padovan
2016-08-05 2:24 ` [PATCH v5 4/5] Documentation: add doc for sync_file_get_fence() Gustavo Padovan
2016-08-05 7:23 ` Chris Wilson
2016-08-05 2:24 ` [PATCH v5 5/5] dma-buf/sync_file: only enable fence signalling on poll() Gustavo Padovan
2016-08-05 7:28 ` Chris Wilson
2016-08-05 7:42 ` Chris Wilson [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160805074216.GG12034@nuc-i3427.alporthouse.com \
--to=chris@chris-wilson.co.uk \
--cc=John.C.Harrison@Intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniels@collabora.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gustavo.padovan@collabora.co.uk \
--cc=gustavo@padovan.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=marcheu@google.com \
--cc=seanpaul@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®