summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_device.h
diff options
context:
space:
mode:
authorMatt Roper <matthew.d.roper@intel.com>2023-06-01 14:52:18 -0700
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-19 18:34:11 -0500
commit3643e6371542cc4782d3700f07130c9d250666d8 (patch)
tree047718f0e6119ac025632eb6522ac3db126654c1 /drivers/gpu/drm/xe/xe_device.h
parentf79ee3013ad57021f4557cd3aa964a14b5c94bd4 (diff)
downloadlwn-3643e6371542cc4782d3700f07130c9d250666d8.tar.gz
lwn-3643e6371542cc4782d3700f07130c9d250666d8.zip
drm/xe: Add for_each_tile iterator
As we start splitting tile handling out from GT handling, we'll need to be able to iterate over tiles separately from GTs. This iterator will be used in upcoming patches. v2: - s/(id__++)/(id__)++/ (Gustavo) Cc: Gustavo Sousa <gustavo.sousa@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Gustavo Sousa <gustavo.sousa@intel.com> Link: https://lore.kernel.org/r/20230601215244.678611-6-matthew.d.roper@intel.com Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_device.h')
-rw-r--r--drivers/gpu/drm/xe/xe_device.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
index f7acaf51a1fc..3516ac1dcbc4 100644
--- a/drivers/gpu/drm/xe/xe_device.h
+++ b/drivers/gpu/drm/xe/xe_device.h
@@ -83,6 +83,10 @@ static inline void xe_device_guc_submission_disable(struct xe_device *xe)
xe->info.enable_guc = false;
}
+#define for_each_tile(tile__, xe__, id__) \
+ for ((id__) = 0; (id__) < (xe__)->info.tile_count; (id__)++) \
+ for_each_if ((tile__) = &(xe__)->tiles[(id__)])
+
#define for_each_gt(gt__, xe__, id__) \
for ((id__) = 0; (id__) < (xe__)->info.tile_count; (id__++)) \
for_each_if ((gt__) = xe_device_get_gt((xe__), (id__)))