Re: [PATCH 6/9] drm/i915: Add function to determine if a slice has a subslice

Summers, Stuart
2019-08-20T19:01:07Z

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

On Tue, 2019-08-20 at 11:53 +0100, Chris Wilson wrote:
> Quoting Stuart Summers (2019-08-19 22:50:00)
> > Add a new function to determine whether a particular slice
> > has a given subslice.
> >
> > Signed-off-by: Stuart Summers <stuart.summers@intel.com>
> > ---
> > drivers/gpu/drm/i915/gt/intel_sseu.h | 10 ++++++++++
> > drivers/gpu/drm/i915/intel_device_info.c | 9 ++++-----
> > 2 files changed, 14 insertions(+), 5 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/gt/intel_sseu.h
> > b/drivers/gpu/drm/i915/gt/intel_sseu.h
> > index 2261d4e7d98b..0ecc1c35a7a1 100644
> > --- a/drivers/gpu/drm/i915/gt/intel_sseu.h
> > +++ b/drivers/gpu/drm/i915/gt/intel_sseu.h
> > @@ -66,6 +66,16 @@ intel_sseu_from_device_info(const struct
> > sseu_dev_info *sseu)
> > return value;
> > }
> >
> > +static inline bool
> > +intel_sseu_has_subslice(const struct sseu_dev_info *sseu, int
> > slice,
> > + int subslice)
> > +{
> > + u8 mask = sseu->subslice_mask[slice * sseu->ss_stride +
> > + subslice / BITS_PER_BYTE];
> > +
>
> Suggestion:
>
> GEM_BUG_ON(subslice >= sseu->ss_slice);

Thanks Chris and makes sense. I think this should instead be (ss /
BITS_PER_BYTE >= ss_stride).

I'll post an update hopefully today on this. Let me know if you'd like
me to drop your R-B with the above change.

Thanks,
Stuart

>
> > + return mask & BIT(subslice % BITS_PER_BYTE);
> > +}
>
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> -Chris

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3270 bytes --]

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