From: Philipp Zabel <p.zabel@pengutronix.de>
To: Gustavo Padovan <gustavo@padovan.org>, Rob Clark <robdclark@gmail.com>
Cc: etnaviv@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
Russell King <linux+etnaviv@armlinux.org.uk>
Subject: Re: [PATCH 1/3] drm/etnaviv: submit support for in-fences
Date: Mon, 13 Mar 2017 11:56:56 +0100 [thread overview]
Message-ID: <1489402616.2288.26.camel@pengutronix.de> (raw)
In-Reply-To: <20170308143748.GA2346@joana>
Hi Gustavo,
thank you for the review.
On Wed, 2017-03-08 at 11:37 -0300, Gustavo Padovan wrote:
[...]
> > @@ -385,6 +396,25 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data,
> > goto err_submit_objects;
> > }
> >
> > + if (args->flags & ETNA_SUBMIT_FENCE_FD_IN) {
> > + in_fence = sync_file_get_fence(args->fence_fd);
> > + if (!in_fence) {
> > + ret = -EINVAL;
> > + goto err_submit_objects;
> > + }
> > +
> > + /* TODO if we get an array-fence due to userspace merging
> > + * multiple fences, we need a way to determine if all the
> > + * backing fences are from our own context..
> > + */
>
> All GPU drivers seem to have the same need on fence_array, so I think we
> can create a fence array helper to inspect if it has a specific context
> or not.
Do you have a pointer where I could read up on how this should be done?
> > +
> > + if (in_fence->context != gpu->fence_context) {
> > + ret = dma_fence_wait(in_fence, true);
> > + if (ret)
> > + goto err_submit_objects;
>
> sync_file_get_fence() hold a fence ref, we need to release it here
> always and not only in case of error.
We do that already. err_submit_objects is an unfortunate name for patch
review, but the out label at the end of the function falls right through
to it.
> > + }
> > + }
> > +
> > ret = submit_fence_sync(submit);
> > if (ret)
> > goto err_submit_objects;
> > @@ -419,6 +449,8 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data,
> > flush_workqueue(priv->wq);
> >
> > err_submit_objects:
> > + if (in_fence)
> > + dma_fence_put(in_fence);
We pass through here in the non-error case, too.
[...]
> > @@ -154,6 +154,10 @@ struct drm_etnaviv_gem_submit_bo {
> > * one or more cmdstream buffers. This allows for conditional execution
> > * (context-restore), and IB buffers needed for per tile/bin draw cmds.
> > */
> > +#define ETNA_SUBMIT_NO_IMPLICIT 0x0001
> > +#define ETNA_SUBMIT_FENCE_FD_IN 0x0002
>
> ETNA_SUBMIT_NO_IMPLICIT and ETNA_SUBMIT_FENCE_FD_IN are the same, when
> you send and fence_fd to the kernel you are requesting on explicit sync
> thus I think the ETNA_SUBMIT_NO_IMPLICIT can be dropped and
> ETNA_SUBMIT_FENCE_FD_IN would be the one to look at.
I just followed Rob's lead. I'm not sure if there may be a reason to
submit an in fence still keep implicit fencing enabled at the same time,
or to allow a submit without any fencing whatsoever. Maybe for testing
purposes?
I'm happy to drop the NO_IMPLICIT flag if there is no need for it.
regards
Philipp
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-03-13 10:56 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 12:53 [PATCH 1/3] drm/etnaviv: submit support for in-fences Philipp Zabel
2017-03-08 12:53 ` [PATCH 2/3] drm/etnaviv: move fence allocation out of etnaviv_gpu_submit() Philipp Zabel
2017-03-08 14:42 ` Gustavo Padovan
2017-03-08 18:28 ` Russell King - ARM Linux
2017-03-13 11:01 ` Philipp Zabel
2017-03-13 17:30 ` Gustavo Padovan
2017-03-08 12:53 ` [PATCH 3/3] drm/etnaviv: submit support for out-fences Philipp Zabel
2017-03-08 14:48 ` Gustavo Padovan
2017-03-13 10:57 ` Philipp Zabel
2017-03-08 14:37 ` [PATCH 1/3] drm/etnaviv: submit support for in-fences Gustavo Padovan
2017-03-13 10:56 ` Philipp Zabel [this message]
2017-03-13 17:37 ` Gustavo Padovan
2017-03-16 11:05 ` Philipp Zabel
2017-03-17 14:00 ` Gustavo Padovan
2017-03-17 14:07 ` Philipp Zabel
2017-03-20 8:14 ` Daniel Vetter
2017-03-17 14:10 ` Lucas Stach
2017-03-17 14:42 ` Russell King - ARM Linux
2017-03-17 14:58 ` Lucas Stach
2017-03-17 15:07 ` Russell King - ARM Linux
2017-03-17 16:13 ` Chris Healy
2017-03-18 14:19 ` Christian König
2017-03-19 14:14 ` Lucas Stach
2017-03-16 14:03 ` Rob Clark
2017-03-17 13:55 ` Gustavo Padovan
2017-03-17 14:09 ` Philipp Zabel
2017-03-17 14:26 ` Lucas Stach
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=1489402616.2288.26.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=dri-devel@lists.freedesktop.org \
--cc=etnaviv@lists.freedesktop.org \
--cc=gustavo@padovan.org \
--cc=linux+etnaviv@armlinux.org.uk \
--cc=robdclark@gmail.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