diff options
author | Matt Roper <matthew.d.roper@intel.com> | 2023-06-02 00:52:16 +0300 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-20 02:34:11 +0300 |
commit | f79ee3013ad57021f4557cd3aa964a14b5c94bd4 (patch) | |
tree | 63bdc71803b05d47c8bed874e41ae0f67dc25bcd /drivers/gpu/drm/xe/xe_ggtt.c | |
parent | a5edc7cdb3875115d1798f4d2057569cf257e7d2 (diff) | |
download | linux-f79ee3013ad57021f4557cd3aa964a14b5c94bd4.tar.xz |
drm/xe: Add backpointer from gt to tile
Rather than a backpointer to the xe_device, a GT should have a
backpointer to its tile (which can then be used to lookup the device if
necessary).
The gt_to_xe() helper macro (which moves from xe_gt.h to xe_gt_types.h)
can and should still be used to jump directly from an xe_gt to
xe_device.
v2:
- Fix kunit test build
- Move a couple changes to the previous patch. (Lucas)
Reviewed-by: Matt Atwood <matthew.s.atwood@intel.com>
Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://lore.kernel.org/r/20230601215244.678611-4-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_ggtt.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_ggtt.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/xe/xe_ggtt.c b/drivers/gpu/drm/xe/xe_ggtt.c index 1ed22b5f89ad..4eefb2b3166c 100644 --- a/drivers/gpu/drm/xe/xe_ggtt.c +++ b/drivers/gpu/drm/xe/xe_ggtt.c @@ -142,14 +142,14 @@ static void xe_ggtt_initial_clear(struct xe_ggtt *ggtt) u64 start, end; /* Display may have allocated inside ggtt, so be careful with clearing here */ - xe_device_mem_access_get(ggtt->gt->xe); + xe_device_mem_access_get(gt_to_xe(ggtt->gt)); mutex_lock(&ggtt->lock); drm_mm_for_each_hole(hole, &ggtt->mm, start, end) xe_ggtt_clear(ggtt, start, end - start); xe_ggtt_invalidate(ggtt->gt); mutex_unlock(&ggtt->lock); - xe_device_mem_access_put(ggtt->gt->xe); + xe_device_mem_access_put(gt_to_xe(ggtt->gt)); } int xe_ggtt_init(struct xe_gt *gt, struct xe_ggtt *ggtt) @@ -286,14 +286,14 @@ static int __xe_ggtt_insert_bo_at(struct xe_ggtt *ggtt, struct xe_bo *bo, if (err) return err; - xe_device_mem_access_get(ggtt->gt->xe); + xe_device_mem_access_get(gt_to_xe(ggtt->gt)); mutex_lock(&ggtt->lock); err = drm_mm_insert_node_in_range(&ggtt->mm, &bo->ggtt_node, bo->size, alignment, 0, start, end, 0); if (!err) xe_ggtt_map_bo(ggtt, bo); mutex_unlock(&ggtt->lock); - xe_device_mem_access_put(ggtt->gt->xe); + xe_device_mem_access_put(gt_to_xe(ggtt->gt)); return err; } @@ -322,7 +322,7 @@ int xe_ggtt_insert_bo(struct xe_ggtt *ggtt, struct xe_bo *bo) void xe_ggtt_remove_node(struct xe_ggtt *ggtt, struct drm_mm_node *node) { - xe_device_mem_access_get(ggtt->gt->xe); + xe_device_mem_access_get(gt_to_xe(ggtt->gt)); mutex_lock(&ggtt->lock); xe_ggtt_clear(ggtt, node->start, node->size); @@ -332,7 +332,7 @@ void xe_ggtt_remove_node(struct xe_ggtt *ggtt, struct drm_mm_node *node) xe_ggtt_invalidate(ggtt->gt); mutex_unlock(&ggtt->lock); - xe_device_mem_access_put(ggtt->gt->xe); + xe_device_mem_access_put(gt_to_xe(ggtt->gt)); } void xe_ggtt_remove_bo(struct xe_ggtt *ggtt, struct xe_bo *bo) |