All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
To: Michel Thierry <michel.thierry@intel.com>,
	Chris Wilson <chris@chris-wilson.co.uk>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH v2 1/2] drm/i915: drop one bit on the hw_id when using guc
Date: Sat, 2 Jun 2018 00:57:31 +0100	[thread overview]
Message-ID: <09ca309b-be4c-dd79-0ed4-87238a9c9003@intel.com> (raw)
In-Reply-To: <01dd6811-deb1-82ce-59c5-4dc6a34ce6fc@intel.com>

On 01/06/18 20:24, Michel Thierry wrote:
> On 6/1/2018 8:10 AM, Chris Wilson wrote:
>> Quoting Lionel Landwerlin (2018-06-01 10:52:14)
>>> We currently using GuC as a proxy to the hardware. When Guc is used in
>>> such mode, it consumes the bit 20 of the hw_id to indicate that the
>>> workload was submitted by proxy.
>>>
>>> So far we probably haven't seen the issue because we need to allocate
>>> 1048576+ contexts to hit this issue. Still, we should avoid allocating
>>> the hw_id on that bit and restriction to bits [0:19] (i.e 20bits
>>> instead of 21).
>>>
>>> v2: Leave the max hw_id computation in i915_gem_context.c (Michel)
>>>
>>> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
>>> BSpec: 1237
>>> ---
>>>   drivers/gpu/drm/i915/i915_drv.h         |  1 +
>>>   drivers/gpu/drm/i915/i915_gem_context.c | 14 +++++++++++---
>>>   drivers/gpu/drm/i915/intel_lrc.c        |  2 +-
>>>   3 files changed, 13 insertions(+), 4 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/i915/i915_drv.h 
>>> b/drivers/gpu/drm/i915/i915_drv.h
>>> index 38157df6ff5c..7088a1c3b6ad 100644
>>> --- a/drivers/gpu/drm/i915/i915_drv.h
>>> +++ b/drivers/gpu/drm/i915/i915_drv.h
>>> @@ -1841,6 +1841,7 @@ struct drm_i915_private {
>>>                   */
>>>                  struct ida hw_ida;
>>>   #define MAX_CONTEXT_HW_ID (1<<21) /* exclusive */
>>> +#define MAX_GUC_CONTEXT_HW_ID (1<<20) /* exclusive */
>>>   #define GEN11_MAX_CONTEXT_HW_ID (1<<11) /* exclusive */
>>>          } contexts;
>>>   diff --git a/drivers/gpu/drm/i915/i915_gem_context.c 
>>> b/drivers/gpu/drm/i915/i915_gem_context.c
>>> index 81f086397d10..fa732592e221 100644
>>> --- a/drivers/gpu/drm/i915/i915_gem_context.c
>>> +++ b/drivers/gpu/drm/i915/i915_gem_context.c
>>> @@ -208,10 +208,18 @@ static int assign_hw_id(struct 
>>> drm_i915_private *dev_priv, unsigned *out)
>>>          int ret;
>>>          unsigned int max;
>>>   -       if (INTEL_GEN(dev_priv) >= 11)
>>> +       if (INTEL_GEN(dev_priv) >= 11) {
>>>                  max = GEN11_MAX_CONTEXT_HW_ID;
>>> -       else
>>> -               max = MAX_CONTEXT_HW_ID;
>>> +       } else {
>>> +               /*
>>> +                * When using GuC in proxy submission, GuC consumes the
>>> +                * highest bit in the context id to indicate proxy 
>>> submission.
>>> +                */
>>> +               max = USES_GUC_SUBMISSION(dev_priv) ?
>>> +                       MAX_GUC_CONTEXT_HW_ID :
>>> +                       MAX_CONTEXT_HW_ID;
>>
>> I'm just going to say mixing if() and ternary ?: isn't great style.
>>
>> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
>
> My r-b from v1 still applies, but since I'm already writing this...
>
> Reviewed-by: Michel Thierry <michel.thierry@intel.com>
>
>
>
Thanks, I should have added it.


-Lionel

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

  reply	other threads:[~2018-06-01 23:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-01  9:52 [PATCH v2 0/2] drm/i915/perf: fix context filtering with GuC & ICL Lionel Landwerlin
2018-06-01  9:52 ` [PATCH v2 1/2] drm/i915: drop one bit on the hw_id when using guc Lionel Landwerlin
2018-06-01 15:10   ` Chris Wilson
2018-06-01 19:24     ` Michel Thierry
2018-06-01 23:57       ` Lionel Landwerlin [this message]
2018-06-01  9:52 ` [PATCH v2 2/2] drm/i915/perf: fix ctx_id read with GuC & ICL Lionel Landwerlin
2018-06-01 15:18   ` Chris Wilson
2018-06-01 17:08     ` Lionel Landwerlin
2018-06-01 19:21       ` Michel Thierry
2018-06-01 10:50 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/perf: fix context filtering with GuC & ICL (rev2) Patchwork
2018-06-01 10:51 ` ✗ Fi.CI.SPARSE: " Patchwork
2018-06-01 11:08 ` ✗ Fi.CI.BAT: failure " Patchwork
2018-06-01 14:00 ` ✓ Fi.CI.IGT: success " 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=09ca309b-be4c-dd79-0ed4-87238a9c9003@intel.com \
    --to=lionel.g.landwerlin@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=michel.thierry@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.