All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Gordon <david.s.gordon@intel.com>
To: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Cc: intel-gfx <intel-gfx@lists.freedesktop.org>,
	Ben Widawsky <benjamin.widawsky@intel.com>
Subject: Re: [PATCH v3] drm/i915/execlists: Move WA_TAIL_DWORDS to callee
Date: Mon, 8 Feb 2016 11:08:12 +0000	[thread overview]
Message-ID: <56B8771C.1020209@intel.com> (raw)
In-Reply-To: <CABVU7+tdrJM4HMYkhny4fjw35Bs-R6f80unHyEYeeUijOP8uLw@mail.gmail.com>

On 05/02/16 22:56, Rodrigo Vivi wrote:
> On Fri, Feb 5, 2016 at 11:31 AM, Dave Gordon <david.s.gordon@intel.com> wrote:
>> From: Chris Wilson <chris@chris-wilson.co.uk>
>>
>> Currently emit-request starts writing to the ring and reserves space
>> for a workaround to be emitted later whilst submitting the request. It
>> is easier to read if the caller only allocates sufficient space for
>> its access (then the reader can quickly verify that the ring begin
>> allocates the exact space for the number of dwords emitted) and closes
>> the access to the ring. During submit, if we need to add the workaround,
>> we can reacquire ring access, in the assurance that we reserved space
>> for ourselves when beginning the request.
>>
>> v3:
>>      Reinstated #define for WA_TAIL_DWORDS so we could accommodate GPUs
>>      that required different amounts of padding, generalised NOOP fill
>>      [Rodrigo Vivi], added W/A space to reserved amount and updated
>>      code comments [Dave Gordon],
>>
>> Originally-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
>> Rewritten-by: Chris Wilson <chris@chris-wilson.co.uk>
>> Further-tweaked-by: Dave Gordon <david.s.gordon@intel.com>
>>
>> Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@gmail.com>
>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>> Cc: Dave Gordon <david.s.gordon@intel.com>
>> Cc: Ben Widawsky <benjamin.widawsky@intel.com>
>> ---
>>   drivers/gpu/drm/i915/intel_lrc.c | 80 ++++++++++++++++++++++++----------------
>>   1 file changed, 49 insertions(+), 31 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
>> index 3a03646..8b278f1 100644
>> --- a/drivers/gpu/drm/i915/intel_lrc.c
>> +++ b/drivers/gpu/drm/i915/intel_lrc.c
>> @@ -225,6 +225,13 @@ enum {
>>   #define GEN8_CTX_ID_SHIFT 32
>>   #define CTX_RCS_INDIRECT_CTX_OFFSET_DEFAULT  0x17
>>
>> +/*
>> + * Reserve space for 2 NOOPs at the end of each request,
>> + * to be used as a workaround for not being allowed to
>> + * do lite restore with HEAD==TAIL (WaIdleLiteRestore).
>> + */
>> +#define WA_TAIL_DWORDS 2
>
> This patch really organize things better, but I still don't like the
> WA_TAIL_DWORDS hardcoded here instead in a place where I can switch
> for different platofms.

1. it's a *workaround* for a hardware limitation. Let's hope it's not 
even necessary on future chips!

2. it's a really small overhead, so why not just define it as the max 
over all supported platforms?

3. it's a macro, that means it's not *hardcoded*; if there's ever a 
platform where we actually need this fix and it's not the same number, 
we can just redefine this as a function call. Would you prefer it to be 
a function-type macro:

#define	WA_TAIL_DWORDS(dev) (2) /* doesn't currently depend on dev */

so that it could more easily be converted to a platform-specific value 
in future?

.Dave.

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

  parent reply	other threads:[~2016-02-08 11:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 19:31 [PATCH v3] drm/i915/execlists: Move WA_TAIL_DWORDS to callee Dave Gordon
2016-02-05 22:56 ` Rodrigo Vivi
2016-02-06  9:33   ` Chris Wilson
2016-02-08 10:59     ` Dave Gordon
2016-02-08 11:08   ` Dave Gordon [this message]
2016-02-08 12:58 ` ✓ Fi.CI.BAT: success for " 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=56B8771C.1020209@intel.com \
    --to=david.s.gordon@intel.com \
    --cc=benjamin.widawsky@intel.com \
    --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 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.