From: Daniel Vetter <daniel@ffwll.ch>
To: Alex Goins <agoins@nvidia.com>
Cc: dri-devel <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH i915 v7 1/2] i915: wait for fence in mmio_flip_work_func
Date: Wed, 25 Nov 2015 08:50:54 +0100 [thread overview]
Message-ID: <20151125075054.GH17050@phenom.ffwll.local> (raw)
In-Reply-To: <alpine.DEB.2.10.1511241811210.5921@agoins-DiGiTS>
On Tue, Nov 24, 2015 at 06:26:00PM -0800, Alex Goins wrote:
> Thanks, Daniel. There sure are a lot of Daniels.
>
> > > + else if (obj->base.dma_buf && obj->base.dma_buf->resv->fence_excl)
> > > + return true;
> >
> > I'm not sure if this is really doing exactly what you want.
> > When a reservation object's exclusive fence has signaled, I think the
> > old pointer in fence_excl is not actually cleared; it keeps pointing
> > to the old exclusive fence until that replaced by another.
> >
> > So, just nake null-check here is like saying "did this reservation
> > object ever have an exclusive fence at some point in the past", which
> > is not necessarily the same as "is there an exclusive fence associated
> > with the buffer that I am about to flip"?
> >
> > The reservation object is a complicated rcu & ww_mutex protected
> > beast, so I would be shy to access any of its fields directly.
>
> Hm, well, the goal is to ensure that mmio_flip is used if we might need to wait
> on a fence, so if there are false positives it shouldn't be lethal.
>
> Nonetheless, you're probably right. Maybe it would be better to use
> !reservation_object_test_signaled_rcu(test_all=FALSE), which should be TRUE iff
> there is an unsignaled exclusive fence attached, meaning we might have to wait.
Yeah I think that's a good idea for better encapsulation of
reservation/fence internals.
-Daniel
>
> > > if (mmio_flip->req)
> > > WARN_ON(__i915_wait_request(mmio_flip->req,
> > > @@ -11196,6 +11203,12 @@ static void intel_mmio_flip_work_func(struct work_struct *work)
> > > false, NULL,
> > > &mmio_flip->i915->rps.mmioflips));
> > >
> > > + /* For framebuffer backed by dmabuf, wait for fence */
> > > + if (obj->base.dma_buf)
> > > + WARN_ON(reservation_object_wait_timeout_rcu(obj->base.dma_buf->resv,
> > > + false, false,
> > > + MAX_SCHEDULE_TIMEOUT) < 0);
> > > +
> >
> > Hmm, don't you want an interrupt-able wait here?
> > And if so, you probably don't want to WARN_ON() -ERESTARTSYS.
>
> I had this as an interruptable wait previously, but I'm not sure how we would
> actually handle an interrupt in that case. Notice also how
> __i915_wait_request(interruptable=FALSE) just above is also an uninterruptable
> wait.
>
> Thanks,
> Alex
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2015-11-25 7:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-24 22:15 [PATCH i915 v7 0/2] PRIME Synchronization Alex Goins
2015-11-24 22:15 ` [PATCH i915 v7 1/2] i915: wait for fence in mmio_flip_work_func Alex Goins
2015-11-25 1:38 ` Daniel Kurtz
2015-11-25 2:26 ` Alex Goins
2015-11-25 7:50 ` Daniel Vetter [this message]
2015-11-24 22:15 ` [PATCH i915 v7 2/2] i915: wait for fence in prepare_plane_fb Alex Goins
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=20151125075054.GH17050@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=agoins@nvidia.com \
--cc=dri-devel@lists.freedesktop.org \
/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