Skip to content

Commit a2d6f86

Browse files
harishchegondiashutoshx
authored andcommitted
drm/xe/topology: Add a function to find the index of the last enabled DSS in a mask
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. Reviewed-by: Ashutosh Dixit <[email protected]> Signed-off-by: Harish Chegondi <[email protected]> Signed-off-by: Ashutosh Dixit <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/79944bb27eb4f7ce5df01f964aebbf431b3a6c61.1740533885.git.harish.chegondi@intel.com
1 parent 1a7460a commit a2d6f86

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

drivers/gpu/drm/xe/xe_gt_topology.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,19 @@ void xe_gt_topology_init(struct xe_gt *gt);
2525

2626
void xe_gt_topology_dump(struct xe_gt *gt, struct drm_printer *p);
2727

28+
/**
29+
* xe_gt_topology_mask_last_dss() - Returns the index of the last DSS in a mask.
30+
* @mask: Input DSS mask
31+
*
32+
* Return: Index of the last DSS in the input DSS mask,
33+
* XE_MAX_DSS_FUSE_BITS if DSS mask is empty.
34+
*/
35+
static inline unsigned int
36+
xe_gt_topology_mask_last_dss(const xe_dss_mask_t mask)
37+
{
38+
return find_last_bit(mask, XE_MAX_DSS_FUSE_BITS);
39+
}
40+
2841
unsigned int
2942
xe_dss_mask_group_ffs(const xe_dss_mask_t mask, int groupsize, int groupnum);
3043

0 commit comments

Comments
 (0)