All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@gmail.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>,
	intel-gfx@lists.freedesktop.org,
	Ben Widawsky <benjamin.widawsky@intel.com>
Subject: Re: [PATCH] drm/i915: Make wa_tail_dwords flexible for future platforms.
Date: Tue, 26 Jan 2016 13:51:19 +0000	[thread overview]
Message-ID: <CABVU7+smUhiry2Tk6ucD=HVb4JFZPfB_wsDCdNK86oT5Ao5StA@mail.gmail.com> (raw)
In-Reply-To: <20160126082958.GC32190@nuc-i3427.alporthouse.com>


[-- Attachment #1.1: Type: text/plain, Size: 3141 bytes --]

On Tue, Jan 26, 2016 at 12:30 AM Chris Wilson <chris@chris-wilson.co.uk>
wrote:

> On Mon, Jan 25, 2016 at 09:17:15PM +0000, Chris Wilson wrote:
> > On Mon, Jan 25, 2016 at 11:29:19AM -0800, Rodrigo Vivi wrote:
> > > +++ b/drivers/gpu/drm/i915/intel_lrc.c
> > > @@ -764,18 +764,18 @@ intel_logical_ring_advance_and_submit(struct
> drm_i915_gem_request *request)
> > >  {
> > >     struct intel_ringbuffer *ringbuf = request->ringbuf;
> > >     struct drm_i915_private *dev_priv = request->i915;
> > > +   int i;
> > >
> > >     intel_logical_ring_advance(ringbuf);
> > >     request->tail = ringbuf->tail;
> > >
> > >     /*
> > > -    * Here we add two extra NOOPs as padding to avoid
> > > +    * Here we add extra NOOPs as padding to avoid
> > >      * lite restore of a context with HEAD==TAIL.
> > > -    *
> > > -    * Caller must reserve WA_TAIL_DWORDS for us!
> > >      */
> > > -   intel_logical_ring_emit(ringbuf, MI_NOOP);
> > > -   intel_logical_ring_emit(ringbuf, MI_NOOP);
> > > +   for (i = 0; i < ringbuf->wa_tail_dwords; i++)
> > > +           intel_logical_ring_emit(ringbuf, MI_NOOP);
> > > +
> > >     intel_logical_ring_advance(ringbuf);
> > >
> > >     if (intel_ring_stopped(request->ring))
> > > @@ -876,6 +876,16 @@ int intel_logical_ring_begin(struct
> drm_i915_gem_request *req, int num_dwords)
> > >     if (ret)
> > >             return ret;
> > >
> > > +   if (IS_GEN8(req->ring->dev) || IS_GEN9(req->ring->dev))
> >
> > req->i915
> >
> > This is attrocious. Just allocate the extra space when required.
>
>
by this logic I should just emit the mi_noops when required as well, right?


> Slightly less grumpy this morning.
>

thanks

>
> 1. This is duplicating the reserved-space mechanism, by open-coding the
> requirements for execlists. Fine-tuning the reserved space per ring may
> be worth it, but probably not. Over reserving space is not a hung issue
> (it just effectively reduces the size of the ring), and the granularity
> is the size of the average request.
>

forgive this clueless mind here, but I don't see how I'm duplicating the
reserved-space...


>
> 2. You are hiding how much space is actually used during request
> emission. This makes review impossible, and we depend upon review to
> verify that the intel_ring_begin() matches the number of dwords emitted.
>

but the mi_noops are hidden on the submit and advance... shouldn't we move
it back to the places that allocates it.


>
> 3. Is this even the right mechanism considering the number of other ways
> of automatically emitting instructions between batches and contexts? We
> cannot answer that as this patch is out of context.
>

yeap, sorry again, I was just going to the easiest path to be able to avoid
the nulls per platform without adding 3 ifs..

But I wonder if you mean on comment "1." that we can live with
WA_TAIL_DWORDS 2 and avoid only the NULLs when needed... Is this the case?


> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>

[-- Attachment #1.2: Type: text/html, Size: 4816 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-01-26 13:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-25 19:29 [PATCH] drm/i915: Make wa_tail_dwords flexible for future platforms Rodrigo Vivi
2016-01-25 19:36 ` Ben Widawsky
2016-01-25 21:17 ` Chris Wilson
2016-01-26  8:29   ` Chris Wilson
2016-01-26 13:51     ` Rodrigo Vivi [this message]
2016-01-26 14:06       ` Chris Wilson
2016-01-27 12:27         ` Dave Gordon
2016-01-27 16:57           ` [PATCH] drm/i915/execlists: Move WA_TAIL_DWORDS to callee Chris Wilson
2016-02-01 14:00             ` Dave Gordon
2016-01-27 16:14 ` ✓ Fi.CI.BAT: success for drm/i915: Make wa_tail_dwords flexible for future platforms Patchwork
2016-01-28 17:08 ` ✗ Fi.CI.BAT: failure for drm/i915: Make wa_tail_dwords flexible for future platforms. (rev2) Patchwork

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='CABVU7+smUhiry2Tk6ucD=HVb4JFZPfB_wsDCdNK86oT5Ao5StA@mail.gmail.com' \
    --to=rodrigo.vivi@gmail.com \
    --cc=benjamin.widawsky@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@intel.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 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.