From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3] drm/i915: Eliminate vmap overhead for cmd parser
Date: Wed, 25 Nov 2015 23:15:58 +0200 [thread overview]
Message-ID: <20151125211558.GA4437@intel.com> (raw)
In-Reply-To: <20151125201343.GI22980@nuc-i3427.alporthouse.com>
On Wed, Nov 25, 2015 at 08:13:43PM +0000, Chris Wilson wrote:
> On Wed, Nov 25, 2015 at 09:51:08PM +0200, Ville Syrjälä wrote:
> > On Fri, Nov 20, 2015 at 03:31:23PM +0000, Chris Wilson wrote:
> > > @@ -1097,6 +1003,7 @@ static bool check_cmd(const struct intel_engine_cs *ring,
> > > }
> > >
> > > #define LENGTH_BIAS 2
> > > +#define MAX_PARTIAL 256
> >
> > There seems to some confusion whether this is bytes or dwords.
>
> Indeed, I can't remember of the top of my head.
>
> (Double checked that the set of commands that I was thinking were 132
> bytes.)
>
> > Also I guess we already end up allocating two pages anyway, so
> > maybe MAX_PARTIAL should just be one page? It's still not big
> > enough to cover the max legal cmd length AFAICS, so I think
> > the WARN in the check needs to be removed.
>
> Sure, rounding up the next 8192 byte slab cache doesn't seem like it
> will bite us.
>
> So #define MAX_PARTIAL_BYTES PAGE_SIZE
>
> > > + in = offset_in_page(batch_start_offset);
> > > + partial = 0;
> > > + for (src_iter = batch_start_offset >> PAGE_SHIFT;
> > > + src_iter < batch_obj->base.size >> PAGE_SHIFT;
> > > + src_iter++) {
> >
> > So we're iterating over all the pages. Should be enough to iterate
> > until batch_start_offset+batch_len I suppose, but as long as we bail
> > out when we run out of batch it should be fine.
>
> Right, this was mostly convenience for writing the loop bounds - it was
> more or less a simple conversion from the old iterator.
>
> > I see there's a batch_len check at the end, but I don't see us handling
> > the case when the user already gives us something with batch_len==0.
> > Maybe that should be rejected somewhere higher up?
>
> batch_len = 0 is filtered out in the caller...
Oh yeah, see it now.
>
> > Also what happens if we don't find MI_BATCH_BUFFER_END before running
> > out of batch? Oh, I see, we set ret=-EINVAL, and clear it to 0 when we
> > find MI_BATCH_BUFFER_END. So that part seems to be fine.
> >
> > > + u32 *cmd, *page_end, *batch_end;
> > > + u32 this;
> > > +
> > > + this = batch_len;
> >
> > I was a bit concerned about batch_len & 3, but we already check for
> > batch_len&7==0 in i915_gem_check_execbuffer(), so it should be good here.
>
> cmdparser_assert(batch_len > 0 && (batch_len & 3) == 0);
>
> as documentation for the contract?
I won't insist, but feel free to add something like that if you
wish.
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-11-25 21:16 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 10:55 cmdparser overhead reduction Chris Wilson
2015-11-20 10:55 ` [PATCH v2 1/6] drm/i915: Eliminate vmap overhead for cmd parser Chris Wilson
2015-11-20 14:41 ` Ville Syrjälä
2015-11-20 14:52 ` Chris Wilson
2015-11-20 15:31 ` [PATCH v3] " Chris Wilson
2015-11-25 19:51 ` Ville Syrjälä
2015-11-25 20:13 ` Chris Wilson
2015-11-25 21:15 ` Ville Syrjälä [this message]
2015-11-20 10:55 ` [PATCH v2 2/6] drm/i915: Cache last cmd descriptor when parsing Chris Wilson
2015-11-20 15:08 ` Ville Syrjälä
2015-11-20 15:44 ` Chris Wilson
2015-12-01 17:30 ` Ville Syrjälä
2015-11-20 10:55 ` [PATCH v2 3/6] drm/i915: Use WC copies on !llc platforms for the command parser Chris Wilson
2015-11-20 15:05 ` Ville Syrjälä
2015-11-20 15:22 ` Chris Wilson
2015-12-01 17:32 ` Ville Syrjälä
2015-11-20 10:55 ` [PATCH v2 4/6] drm/i915: Reduce arithmetic operations during cmd parser lookup Chris Wilson
2015-11-20 15:02 ` Ville Syrjälä
2015-11-20 10:56 ` [PATCH v2 5/6] drm/i915: Reduce pointer indirection " Chris Wilson
2015-11-20 15:27 ` Ville Syrjälä
2015-11-20 15:34 ` Chris Wilson
2015-11-20 15:47 ` Ville Syrjälä
2015-11-23 8:09 ` Jani Nikula
2015-12-01 17:39 ` Ville Syrjälä
2015-11-20 10:56 ` [PATCH v2 6/6] drm/i915: Improve hash function for the command parser Chris Wilson
2015-11-20 15:13 ` Ville Syrjälä
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=20151125211558.GA4437@intel.com \
--to=ville.syrjala@linux.intel.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox