diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2023-07-26 09:07:03 -0700 |
---|---|---|
committer | Rodrigo Vivi <rodrigo.vivi@intel.com> | 2023-12-21 11:39:05 -0500 |
commit | 937b4be72baaba00fa71a02adac3716332876fa3 (patch) | |
tree | cdca8054c66feb169b9cf76a78e651da6cdaccd5 /drivers/gpu/drm/xe/xe_bo.c | |
parent | 621c1fbd9b83fb6a731e0063ad4ea2d89ec20a9c (diff) |
drm/xe: Decouple vram check from xe_bo_addr()
The output arg is_vram in xe_bo_addr() is unused by several callers.
It's also not what the function is mainly doing. Remove the argument and
let the interested callers to call xe_bo_is_vram().
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://lore.kernel.org/r/20230726160708.3967790-6-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_bo.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_bo.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c index d89cf93acb61..d4e60a96ed64 100644 --- a/drivers/gpu/drm/xe/xe_bo.c +++ b/drivers/gpu/drm/xe/xe_bo.c @@ -1526,12 +1526,11 @@ int xe_bo_pin(struct xe_bo *bo) if (IS_DGFX(xe) && !(IS_ENABLED(CONFIG_DRM_XE_DEBUG) && bo->flags & XE_BO_INTERNAL_TEST)) { struct ttm_place *place = &(bo->placements[0]); - bool vram; if (mem_type_is_vram(place->mem_type)) { XE_BUG_ON(!(place->flags & TTM_PL_FLAG_CONTIGUOUS)); - place->fpfn = (xe_bo_addr(bo, 0, PAGE_SIZE, &vram) - + place->fpfn = (xe_bo_addr(bo, 0, PAGE_SIZE) - vram_region_gpu_offset(bo->ttm.resource)) >> PAGE_SHIFT; place->lpfn = place->fpfn + (bo->size >> PAGE_SHIFT); @@ -1656,8 +1655,7 @@ bool xe_bo_is_xe_bo(struct ttm_buffer_object *bo) * address, such as printing debug information, but not in cases where memory is * written based on this result. */ -dma_addr_t __xe_bo_addr(struct xe_bo *bo, u64 offset, - size_t page_size, bool *is_vram) +dma_addr_t __xe_bo_addr(struct xe_bo *bo, u64 offset, size_t page_size) { struct xe_res_cursor cur; u64 page; @@ -1666,9 +1664,7 @@ dma_addr_t __xe_bo_addr(struct xe_bo *bo, u64 offset, page = offset >> PAGE_SHIFT; offset &= (PAGE_SIZE - 1); - *is_vram = xe_bo_is_vram(bo); - - if (!*is_vram && !xe_bo_is_stolen(bo)) { + if (!xe_bo_is_vram(bo) && !xe_bo_is_stolen(bo)) { XE_BUG_ON(!bo->ttm.ttm); xe_res_first_sg(xe_bo_get_sg(bo), page << PAGE_SHIFT, @@ -1683,12 +1679,11 @@ dma_addr_t __xe_bo_addr(struct xe_bo *bo, u64 offset, } } -dma_addr_t xe_bo_addr(struct xe_bo *bo, u64 offset, - size_t page_size, bool *is_vram) +dma_addr_t xe_bo_addr(struct xe_bo *bo, u64 offset, size_t page_size) { if (!READ_ONCE(bo->ttm.pin_count)) xe_bo_assert_held(bo); - return __xe_bo_addr(bo, offset, page_size, is_vram); + return __xe_bo_addr(bo, offset, page_size); } int xe_bo_vmap(struct xe_bo *bo) |