[PATCH v8 1/7] drm/xe/topology: Add a function to find the index of the last enabled DSS in a mask
Harish Chegondi
harish.chegondi at intel.com
Wed Jan 22 05:18:35 UTC 2025
On Fri, Jan 17, 2025 at 09:25:59AM -0800, Dixit, Ashutosh wrote:
> On Wed, 15 Jan 2025 12:02:07 -0800, Harish Chegondi wrote:
> >
> > Last enabled DSS in a DSS mask can help estimate the maximum DSSes enabled
> > in the DSS mask, as the enabled DSSes can be discontiguous.
> >
> > Signed-off-by: Harish Chegondi <harish.chegondi at intel.com>
> > ---
> > drivers/gpu/drm/xe/xe_gt_topology.h | 13 +++++++++++++
> > 1 file changed, 13 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/xe/xe_gt_topology.h b/drivers/gpu/drm/xe/xe_gt_topology.h
> > index 746b325bbf6e..a72d26ba0653 100644
> > --- a/drivers/gpu/drm/xe/xe_gt_topology.h
> > +++ b/drivers/gpu/drm/xe/xe_gt_topology.h
> > @@ -25,6 +25,19 @@ void xe_gt_topology_init(struct xe_gt *gt);
> >
> > void xe_gt_topology_dump(struct xe_gt *gt, struct drm_printer *p);
> >
> > +/**
> > + * xe_gt_topology_mask_last_dss() - Returns the index of the last DSS in a mask.
> > + * @mask: Input DSS mask
> > + *
> > + * Return: Index of the last DSS in the input DSS mask,
> > + * XE_MAX_DSS_FUSE_BITS if DSS mask is empty.
> > + */
> > +static inline unsigned int
>
> u32?
>
> > +xe_gt_topology_mask_last_dss(const xe_dss_mask_t mask)
> > +{
> > + return find_last_bit(mask, XE_MAX_DSS_FUSE_BITS);
> > +}
> > +
>
> The convention here seems to be to keep function definitions in .c and
> declarations in .h?
Yes, usually. But if it is a single liner, it is okay to put it in the
header file as a static inline as per the review feedback in V4:
https://patchwork.freedesktop.org/patch/619491/?series=139931&rev=1
>
> > unsigned int
> > xe_dss_mask_group_ffs(const xe_dss_mask_t mask, int groupsize, int groupnum);
> >
> > --
> > 2.47.1
> >
More information about the Intel-xe
mailing list