summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_guc_log.c
diff options
context:
space:
mode:
authorMichał Winiarski <michal.winiarski@intel.com>2023-12-05 04:33:04 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 19:45:11 +0300
commit0e1a47fcabc8ffa6f460c60c2caa04e51170fa22 (patch)
tree71a656ac72797387779a70d2524be3cc48640dfe /drivers/gpu/drm/xe/xe_guc_log.c
parent791d0362a9e2d47352ee6b35cc8999cb3404e27c (diff)
downloadlinux-0e1a47fcabc8ffa6f460c60c2caa04e51170fa22.tar.xz
drm/xe: Add a helper for DRM device-lifetime BO create
A helper for managed BO allocations makes it possible to remove specific "fini" actions and will simplify the following patches adding ability to execute a release action for specific BO directly. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_guc_log.c')
-rw-r--r--drivers/gpu/drm/xe/xe_guc_log.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc_log.c b/drivers/gpu/drm/xe/xe_guc_log.c
index 27c3827bfd05..bcd2f4d34081 100644
--- a/drivers/gpu/drm/xe/xe_guc_log.c
+++ b/drivers/gpu/drm/xe/xe_guc_log.c
@@ -77,24 +77,15 @@ void xe_guc_log_print(struct xe_guc_log *log, struct drm_printer *p)
}
}
-static void guc_log_fini(struct drm_device *drm, void *arg)
-{
- struct xe_guc_log *log = arg;
-
- xe_bo_unpin_map_no_vm(log->bo);
-}
-
int xe_guc_log_init(struct xe_guc_log *log)
{
struct xe_device *xe = log_to_xe(log);
struct xe_tile *tile = gt_to_tile(log_to_gt(log));
struct xe_bo *bo;
- int err;
- bo = xe_bo_create_pin_map(xe, tile, NULL, guc_log_size(),
- ttm_bo_type_kernel,
- XE_BO_CREATE_VRAM_IF_DGFX(tile) |
- XE_BO_CREATE_GGTT_BIT);
+ bo = xe_managed_bo_create_pin_map(xe, tile, guc_log_size(),
+ XE_BO_CREATE_VRAM_IF_DGFX(tile) |
+ XE_BO_CREATE_GGTT_BIT);
if (IS_ERR(bo))
return PTR_ERR(bo);
@@ -102,9 +93,5 @@ int xe_guc_log_init(struct xe_guc_log *log)
log->bo = bo;
log->level = xe_modparam.guc_log_level;
- err = drmm_add_action_or_reset(&xe->drm, guc_log_fini, log);
- if (err)
- return err;
-
return 0;
}