aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_guc_ads.c
diff options
context:
space:
mode:
authorMichał Winiarski <michal.winiarski@intel.com>2023-12-05 02:33:04 +0100
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-21 11:45:11 -0500
commit0e1a47fcabc8ffa6f460c60c2caa04e51170fa22 (patch)
tree71a656ac72797387779a70d2524be3cc48640dfe /drivers/gpu/drm/xe/xe_guc_ads.c
parent791d0362a9e2d47352ee6b35cc8999cb3404e27c (diff)
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_ads.c')
-rw-r--r--drivers/gpu/drm/xe/xe_guc_ads.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/gpu/drm/xe/xe_guc_ads.c b/drivers/gpu/drm/xe/xe_guc_ads.c
index 88789826e781..2f5ff090aa6b 100644
--- a/drivers/gpu/drm/xe/xe_guc_ads.c
+++ b/drivers/gpu/drm/xe/xe_guc_ads.c
@@ -202,13 +202,6 @@ static size_t guc_ads_size(struct xe_guc_ads *ads)
guc_ads_private_data_size(ads);
}
-static void guc_ads_fini(struct drm_device *drm, void *arg)
-{
- struct xe_guc_ads *ads = arg;
-
- xe_bo_unpin_map_no_vm(ads->bo);
-}
-
static bool needs_wa_1607983814(struct xe_device *xe)
{
return GRAPHICS_VERx100(xe) < 1250;
@@ -274,25 +267,18 @@ int xe_guc_ads_init(struct xe_guc_ads *ads)
struct xe_gt *gt = ads_to_gt(ads);
struct xe_tile *tile = gt_to_tile(gt);
struct xe_bo *bo;
- int err;
ads->golden_lrc_size = calculate_golden_lrc_size(ads);
ads->regset_size = calculate_regset_size(gt);
- bo = xe_bo_create_pin_map(xe, tile, NULL, guc_ads_size(ads) +
- MAX_GOLDEN_LRC_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_ads_size(ads) + MAX_GOLDEN_LRC_SIZE,
+ XE_BO_CREATE_VRAM_IF_DGFX(tile) |
+ XE_BO_CREATE_GGTT_BIT);
if (IS_ERR(bo))
return PTR_ERR(bo);
ads->bo = bo;
- err = drmm_add_action_or_reset(&xe->drm, guc_ads_fini, ads);
- if (err)
- return err;
-
return 0;
}