diff options
author | Matt Roper <matthew.d.roper@intel.com> | 2023-06-01 14:52:15 -0700 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-19 18:34:11 -0500 |
commit | a5edc7cdb3875115d1798f4d2057569cf257e7d2 (patch) | |
tree | bdde4b5283179ceb35be1b995630d1b51befe2c4 /drivers/gpu/drm/xe/xe_device.h | |
parent | dbc4f5d15a8eecf0f5e7ba1a8e563c31237f6adb (diff) |
drm/xe: Introduce xe_tile
Create a new xe_tile structure to begin separating the concept of "tile"
from "GT." A tile is effectively a complete GPU, and a GT is just one
part of that. On platforms like MTL, there's only a single full GPU
(tile) which has its IP blocks provided by two GTs. In contrast, a
"multi-tile" platform like PVC is basically multiple complete GPUs
packed behind a single PCI device.
For now, just create xe_tile as a simple wrapper around xe_gt. The
items in xe_gt that are truly tied to the tile rather than the GT will
be moved in future patches. Support for multiple GTs per tile (i.e.,
the MTL standalone media case) will also be re-introduced in a future
patch.
v2:
- Fix kunit test build
- Move hunk from next patch to use local tile variable rather than
direct xe->tiles[id] accesses. (Lucas)
- Mention compute in kerneldoc. (Rodrigo)
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20230601215244.678611-3-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.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h index cbae480a2092..f7acaf51a1fc 100644 --- a/drivers/gpu/drm/xe/xe_device.h +++ b/drivers/gpu/drm/xe/xe_device.h @@ -48,12 +48,17 @@ static inline struct xe_file *to_xe_file(const struct drm_file *file) return file->driver_priv; } +static inline struct xe_tile *xe_device_get_root_tile(struct xe_device *xe) +{ + return &xe->tiles[0]; +} + static inline struct xe_gt *xe_device_get_gt(struct xe_device *xe, u8 gt_id) { struct xe_gt *gt; - XE_BUG_ON(gt_id > XE_MAX_GT); - gt = xe->gt + gt_id; + XE_BUG_ON(gt_id > XE_MAX_TILES_PER_DEVICE); + gt = &xe->tiles[gt_id].primary_gt; XE_BUG_ON(gt->info.id != gt_id); XE_BUG_ON(gt->info.type == XE_GT_TYPE_UNINITIALIZED); @@ -65,7 +70,7 @@ static inline struct xe_gt *xe_device_get_gt(struct xe_device *xe, u8 gt_id) */ static inline struct xe_gt *to_gt(struct xe_device *xe) { - return xe->gt; + return &xe_device_get_root_tile(xe)->primary_gt; } static inline bool xe_device_guc_submission_enabled(struct xe_device *xe) |