Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Gordon <david.s.gordon@intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Widawsky, Benjamin" <benjamin.widawsky@intel.com>
Subject: Re: [PATCH v5] drm/i915/execlists: Move WA_TAIL_DWORDS to callee
Date: Thu, 25 Feb 2016 12:19:17 +0000	[thread overview]
Message-ID: <56CEF145.4010808@intel.com> (raw)
In-Reply-To: <20160225100552.GD30250@nuc-i3427.alporthouse.com>

On 25/02/16 10:05, Chris Wilson wrote:
> On Wed, Feb 24, 2016 at 10:02:58AM +0000, Dave Gordon wrote:
>> @@ -907,7 +942,8 @@ int intel_logical_ring_reserve_space(struct drm_i915_gem_request *request)
>>   	 * adding any commands to it then there might not actually be
>>   	 * sufficient room for the submission commands.
>>   	 */
>> -	intel_ring_reserved_space_reserve(request->ringbuf, MIN_SPACE_FOR_ADD_REQUEST);
>> +	intel_ring_reserved_space_reserve(request->ringbuf,
>> +		MIN_SPACE_FOR_ADD_REQUEST + WA_TAIL_DWORDS(request));
>
> No, no and thrice no. MIN_SPACE_FOR_ADD_REQUEST already has to and does
> take this into account. We either make it variable and universally compute
> it per-engine/per-gen or keep using the fixed constant that is large enough
> for everybody. This code should remain common to all paths until the
> duplication is removed.
> -Chris

As I said on the last iteration:

I didn't put it there because we *needed* the extra space -- as you say, 
the constant is already large enough -- but rather so that people 
changing either of those two values would be more likely to think about 
whether there were any unexpected interactions.

The sum of two constants is still just a constant. We *could* just 
update the comment about how MIN_SPACE_FOR_ADD_REQUEST was arrived at, 
noting that includes enough space for any possible workaround on any 
platform, without even changing the value. But that's more likely to get 
ignored if anyone ever finds a reason to increase the size of the 
padding (for example, if a context can be resubmitted more than once due 
to preemption, do we need to apply the workaround of adding 2 DWords 
EACH time?)

When we come to *use* the padding (in intel_logical_ring_submit()), 
there's a comment noting that the ring_begin() "is safe because we 
reserved the space earlier". So mentioning the padding at the point of 
allocation helps tie these two together and makes it clearer that the 
padding being consumed here is the same padding reserved earlier.

But the whole point of Rodrigo's original patch:
   drm/i915: Make wa_tail_dwords flexible for future platforms.
was to make this NOT (necessarily) a constant -- in which case we MUST 
add it to the reserved amount at the point of allocation, as above.
The commit message noted:
   we don't have a clean way to implement or remove WaIdleLiteRestore
   for different platforms.
   This patch aims to let it more flexible. So we just emit the NOOPs
   equivalent of what was initialized.
   Also let's just include the platforms we know that needs this Wa,
   i.e gen8 and gen9 platforms.

Personally, I'm not convinced that it really *needs* to be dynamic; but 
the implementation above /allows/ it to be so if it's ever necessary -- 
thus satisfying Rodrigo's intent -- while adding no overhead as long as 
the actual value remains a constant.

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

      reply	other threads:[~2016-02-25 12:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-24 10:02 [PATCH v5] drm/i915/execlists: Move WA_TAIL_DWORDS to callee Dave Gordon
2016-02-25 10:05 ` Chris Wilson
2016-02-25 12:19   ` Dave Gordon [this message]

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=56CEF145.4010808@intel.com \
    --to=david.s.gordon@intel.com \
    --cc=benjamin.widawsky@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@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