mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 06:01:57 +00:00
drm/xe: Update xe_sa to use xe_managed_bo_create_pin_map
Preferred way to create kernel BOs is xe_managed_bo_create_pin_map, use it. Signed-off-by: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Lucas De Marchi <lucas.demarchi@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240820172958.1095143-7-matthew.brost@intel.com
This commit is contained in:
parent
6eb2aad402
commit
501d943893
@ -25,10 +25,9 @@ static void xe_sa_bo_manager_fini(struct drm_device *drm, void *arg)
|
||||
|
||||
drm_suballoc_manager_fini(&sa_manager->base);
|
||||
|
||||
if (bo->vmap.is_iomem)
|
||||
if (sa_manager->is_iomem)
|
||||
kvfree(sa_manager->cpu_ptr);
|
||||
|
||||
xe_bo_unpin_map_no_vm(bo);
|
||||
sa_manager->bo = NULL;
|
||||
}
|
||||
|
||||
@ -47,16 +46,17 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32
|
||||
|
||||
sa_manager->bo = NULL;
|
||||
|
||||
bo = xe_bo_create_pin_map(xe, tile, NULL, size, ttm_bo_type_kernel,
|
||||
XE_BO_FLAG_VRAM_IF_DGFX(tile) |
|
||||
XE_BO_FLAG_GGTT |
|
||||
XE_BO_FLAG_GGTT_INVALIDATE);
|
||||
bo = xe_managed_bo_create_pin_map(xe, tile, size,
|
||||
XE_BO_FLAG_VRAM_IF_DGFX(tile) |
|
||||
XE_BO_FLAG_GGTT |
|
||||
XE_BO_FLAG_GGTT_INVALIDATE);
|
||||
if (IS_ERR(bo)) {
|
||||
drm_err(&xe->drm, "failed to allocate bo for sa manager: %ld\n",
|
||||
PTR_ERR(bo));
|
||||
return (struct xe_sa_manager *)bo;
|
||||
}
|
||||
sa_manager->bo = bo;
|
||||
sa_manager->is_iomem = bo->vmap.is_iomem;
|
||||
|
||||
drm_suballoc_manager_init(&sa_manager->base, managed_size, align);
|
||||
sa_manager->gpu_addr = xe_bo_ggtt_addr(bo);
|
||||
@ -64,7 +64,6 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32
|
||||
if (bo->vmap.is_iomem) {
|
||||
sa_manager->cpu_ptr = kvzalloc(managed_size, GFP_KERNEL);
|
||||
if (!sa_manager->cpu_ptr) {
|
||||
xe_bo_unpin_map_no_vm(sa_manager->bo);
|
||||
sa_manager->bo = NULL;
|
||||
return ERR_PTR(-ENOMEM);
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ struct xe_sa_manager {
|
||||
struct xe_bo *bo;
|
||||
u64 gpu_addr;
|
||||
void *cpu_ptr;
|
||||
bool is_iomem;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user