[Intel-xe] [PATCH 04/19] drm/xe: Add helper to get dss per group
Lucas De Marchi
lucas.demarchi at intel.com
Tue Mar 7 09:24:31 UTC 2023
This is already used in intel_gt_mcr and will be used in workarounds.
Add helpers so the platform-dependency is in a single place.
Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
---
drivers/gpu/drm/xe/xe_gt_mcr.c | 2 +-
drivers/gpu/drm/xe/xe_gt_topology.c | 6 ++++++
drivers/gpu/drm/xe/xe_gt_topology.h | 3 +++
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_gt_mcr.c b/drivers/gpu/drm/xe/xe_gt_mcr.c
index a42061c4b9d2..694a79b40ec0 100644
--- a/drivers/gpu/drm/xe/xe_gt_mcr.c
+++ b/drivers/gpu/drm/xe/xe_gt_mcr.c
@@ -223,7 +223,7 @@ static void init_steering_dss(struct xe_gt *gt)
{
unsigned int dss = min(xe_dss_mask_group_ffs(gt->fuse_topo.g_dss_mask, 0, 0),
xe_dss_mask_group_ffs(gt->fuse_topo.c_dss_mask, 0, 0));
- unsigned int dss_per_grp = gt_to_xe(gt)->info.platform == XE_PVC ? 8 : 4;
+ unsigned int dss_per_grp = xe_gt_topology_get_dss_per_group(gt);
gt->steering[DSS].group_target = dss / dss_per_grp;
gt->steering[DSS].instance_target = dss % dss_per_grp;
diff --git a/drivers/gpu/drm/xe/xe_gt_topology.c b/drivers/gpu/drm/xe/xe_gt_topology.c
index 967f2349c67a..9fe06a46a400 100644
--- a/drivers/gpu/drm/xe/xe_gt_topology.c
+++ b/drivers/gpu/drm/xe/xe_gt_topology.c
@@ -103,6 +103,12 @@ xe_gt_topology_dump(struct xe_gt *gt, struct drm_printer *p)
}
+unsigned int
+xe_gt_topology_get_dss_per_group(struct xe_gt *gt)
+{
+ return gt_to_xe(gt)->info.platform == XE_PVC ? 8 : 4;
+}
+
/*
* Used to obtain the index of the first DSS. Can start searching from the
* beginning of a specific dss group (e.g., gslice, cslice, etc.) if
diff --git a/drivers/gpu/drm/xe/xe_gt_topology.h b/drivers/gpu/drm/xe/xe_gt_topology.h
index 2375f005e0c8..cf8f75a4c7dd 100644
--- a/drivers/gpu/drm/xe/xe_gt_topology.h
+++ b/drivers/gpu/drm/xe/xe_gt_topology.h
@@ -14,6 +14,9 @@ void xe_gt_topology_init(struct xe_gt *gt);
void xe_gt_topology_dump(struct xe_gt *gt, struct drm_printer *p);
+unsigned int
+xe_gt_topology_get_dss_per_group(struct xe_gt *gt);
+
unsigned int
xe_dss_mask_group_ffs(const xe_dss_mask_t mask, int groupsize, int groupnum);
--
2.39.0
More information about the Intel-xe
mailing list