[PATCH v2 1/6] drm/i915: Add the FIRST_CCS() helper
Andi Shyti
andi.shyti at linux.intel.com
Thu Mar 27 11:05:34 UTC 2025
On Thu, Mar 27, 2025 at 12:42:50PM +0200, Jani Nikula wrote:
> On Thu, 27 Mar 2025, Andi Shyti <andi.shyti at linux.intel.com> wrote:
> > From: Andi Shyti <andi.shyti at intel.com>
> >
> > Some GPUs, like DG2, can host more than one CCS engine. Some
> > workarounds or enablements need to happen only once for all the
> > engines in the GT—for example, on the engine with the lowest
> > instance.
> >
> > The FIRST_CCS() helper first checks if the engine is a Compute
> > engine, and then whether it's the one with the lowest instance.
> >
> > Signed-off-by: Andi Shyti <andi.shyti at intel.com>
> > ---
> > drivers/gpu/drm/i915/i915_drv.h | 3 +++
> > 1 file changed, 3 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 54538b6f85df..5cb501393c4b 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -619,6 +619,9 @@ IS_SUBPLATFORM(const struct drm_i915_private *i915,
> > #define CCS_MASK(gt) \
> > ENGINE_INSTANCES_MASK(gt, CCS0, I915_MAX_CCS)
> >
> > +#define FIRST_CCS(e__) \
> > + (CCS_MASK(e__->gt) && (__ffs(CCS_MASK(e__->gt)) == e__->instance))
> > +
>
> Could I persuade you to find a more specific header file for this, along
> with the CCS_MASK etc.?
yes, sure, I think this should go inside the gt/ (I don't also
like the name FIRST_CCS but could not come out with anything
better).
All the engine related defines should go inside the gt/, I will
take care of it, but that's argument for another patch.
Thanks, Jani,
Andi
More information about the Intel-gfx
mailing list