From: Jesse Barnes <jbarnes@virtuousgeek.org>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/2] drm/i915: allow sync points within batches
Date: Wed, 3 Sep 2014 12:01:49 -0700 [thread overview]
Message-ID: <20140903120149.799b03aa@jbarnes-desktop> (raw)
In-Reply-To: <20140903160853.GA3171@nuc-i3427.alporthouse.com>
On Wed, 3 Sep 2014 17:08:53 +0100
Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Wed, Sep 03, 2014 at 08:41:06AM -0700, Jesse Barnes wrote:
> > On Wed, 3 Sep 2014 08:01:55 +0100
> > Chris Wilson <chris@chris-wilson.co.uk> wrote:
> >
> > > These commands are illegal/invalid inside the object, only valid inside
> > > the ring.
> >
> > Hm, we ought to be able to write to no privileged space with
> > STORE_DWORD, but that does mean moving to context specific pages in
> > process space, or at least adding them to our existing scheme.
>
> The per-process context page also doesn't exist generically. I certainly
> hope that userspace can't overwrite the hws! Imagine if we were using
> that for interrupt status reads, or seqno tracking...
Yeah I'm thinking of an additional hws that's per-context and userspace
mappable. It could come in handy for userspace only sync stuff.
>
> > I haven't tried MI_USER_INTERRUPT from a batch, if we can't do it from
> > a non-privileged batch that nixes one of the other neat features we
> > could have (fine grained intra-batch userspace synchronization).
>
> I don't understand how writing the operation into the batch is
> beneficial vs writing into the ring, unless you instended to use
> something more fine grained than the batch seqno. You want to get
> interrupts from inside batches? Rather than continue the existing scheme
> of splitting up batches between fences?
Yeah, the whole idea here was to avoid flushing batches in order to
emit fences, both to avoid overhead and give userspace more rope.
>
> I definitely think we should think twice before allowing userspace to
> arbitrarily generate interrupts.
>
> > > > + return 0;
> > > > +}
> > > >
> > > > static int
> > > > relocate_entry_cpu(struct drm_i915_gem_object *obj,
> > > > @@ -349,7 +411,8 @@ relocate_entry_gtt(struct drm_i915_gem_object *obj,
> > > > static int
> > > > i915_gem_execbuffer_relocate_entry(struct drm_i915_gem_object *obj,
> > > > struct eb_vmas *eb,
> > > > - struct drm_i915_gem_relocation_entry *reloc)
> > > > + struct drm_i915_gem_relocation_entry *reloc,
> > > > + struct intel_context *ctx)
> > >
> > > Hmm. That's a nuisance. But no, you only use it to automatically create
> > > a fence not to patch the batch, so you can just use an object-flag.
> > >
> > > This fits neatly into requests.
> >
> > Most definitely. What do you think of the potential upside in the DDX
> > for this, assuming we get dword writes from batches working?
>
> Negative. You now have relocation overhead, you still need to split
> batches to keep the gpu busy and do ring switches, and context switching
> between clients, so I don't feel a need for fences from inside a batch.
>
> Getting seqno and a hws in the client would be nice, but if it continues
> to require kernel polling, no thanks, I'll just still to approximately
> tracking the active state of surfaces with the heavier accurate queries
> sparingly.
>
> About the only thing I could see as being useful is that it would allow
> you to reuse a batch buffer multiple times, rather than overallocate a
> whole page and keep a pool of such pages.
>
> I am missing something?
No I think that's about right. The need for reloc processing is a
definite downside to this approach, but that could be solved with a new
interface, or by just allowing userspace to map/manage a hws. The
downside there is that the resulting fences wouldn't be shareable. But
requiring a flush for that is probably fine.
--
Jesse Barnes, Intel Open Source Technology Center
next prev parent reply other threads:[~2014-09-03 19:01 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 21:32 Updated fence patches Jesse Barnes
2014-09-02 21:32 ` [PATCH 1/2] drm/i915: Android sync points for i915 v2 Jesse Barnes
2014-09-03 7:09 ` Chris Wilson
2014-09-03 16:41 ` Ville Syrjälä
2014-09-03 17:05 ` Chris Wilson
2014-09-03 17:12 ` Chris Wilson
2014-09-02 21:32 ` [PATCH 2/2] drm/i915: allow sync points within batches Jesse Barnes
2014-09-03 7:01 ` Chris Wilson
2014-09-03 15:41 ` Jesse Barnes
2014-09-03 16:08 ` Chris Wilson
2014-09-03 19:01 ` Jesse Barnes [this message]
2014-09-03 19:41 ` Daniel Vetter
2014-09-03 19:48 ` Jesse Barnes
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=20140903120149.799b03aa@jbarnes-desktop \
--to=jbarnes@virtuousgeek.org \
--cc=chris@chris-wilson.co.uk \
--cc=intel-gfx@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 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.