[PATCH] drm/xe: Fix xe_bo_evict build error
Matthew Brost
matthew.brost at intel.com
Mon Apr 28 16:57:44 UTC 2025
On Mon, Apr 28, 2025 at 12:09:56PM +0530, Tejas Upadhyay wrote:
> Fix declarations and usage of xe_bo_evict with force_alloc
> to avoid build error.
>
drm-tip appears to have this. What branch are you builing on? I could
drm-xe-next perhaps being broken and needing a backport from whatever
branch the original patch by Dave was merged through.
Matt
> Fixes: 84a11c519234 ("drm/xe: Drop force_alloc from xe_bo_evict in selftests")
> Signed-off-by: Tejas Upadhyay <tejas.upadhyay at intel.com>
> ---
> drivers/gpu/drm/xe/xe_bo.c | 4 +---
> drivers/gpu/drm/xe/xe_bo.h | 2 +-
> drivers/gpu/drm/xe/xe_dma_buf.c | 2 +-
> 3 files changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index 897caa145663..3a84a9d92c48 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -2930,19 +2930,17 @@ int xe_bo_migrate(struct xe_bo *bo, u32 mem_type)
> /**
> * xe_bo_evict - Evict an object to evict placement
> * @bo: The buffer object to migrate.
> - * @force_alloc: Set force_alloc in ttm_operation_ctx
> *
> * On successful completion, the object memory will be moved to evict
> * placement. This function blocks until the object has been fully moved.
> *
> * Return: 0 on success. Negative error code on failure.
> */
> -int xe_bo_evict(struct xe_bo *bo, bool force_alloc)
> +int xe_bo_evict(struct xe_bo *bo)
> {
> struct ttm_operation_ctx ctx = {
> .interruptible = false,
> .no_wait_gpu = false,
> - .force_alloc = force_alloc,
> .gfp_retry_mayfail = true,
> };
> struct ttm_placement placement;
> diff --git a/drivers/gpu/drm/xe/xe_bo.h b/drivers/gpu/drm/xe/xe_bo.h
> index 8bc449c78cc7..02ada1fb8a23 100644
> --- a/drivers/gpu/drm/xe/xe_bo.h
> +++ b/drivers/gpu/drm/xe/xe_bo.h
> @@ -274,7 +274,7 @@ uint64_t vram_region_gpu_offset(struct ttm_resource *res);
> bool xe_bo_can_migrate(struct xe_bo *bo, u32 mem_type);
>
> int xe_bo_migrate(struct xe_bo *bo, u32 mem_type);
> -int xe_bo_evict(struct xe_bo *bo, bool force_alloc);
> +int xe_bo_evict(struct xe_bo *bo);
>
> int xe_bo_evict_pinned(struct xe_bo *bo);
> int xe_bo_notifier_prepare_pinned(struct xe_bo *bo);
> diff --git a/drivers/gpu/drm/xe/xe_dma_buf.c b/drivers/gpu/drm/xe/xe_dma_buf.c
> index f7a20264ea33..346f857f3837 100644
> --- a/drivers/gpu/drm/xe/xe_dma_buf.c
> +++ b/drivers/gpu/drm/xe/xe_dma_buf.c
> @@ -233,7 +233,7 @@ static void xe_dma_buf_move_notify(struct dma_buf_attachment *attach)
> struct drm_gem_object *obj = attach->importer_priv;
> struct xe_bo *bo = gem_to_xe_bo(obj);
>
> - XE_WARN_ON(xe_bo_evict(bo, false));
> + XE_WARN_ON(xe_bo_evict(bo));
> }
>
> static const struct dma_buf_attach_ops xe_dma_buf_attach_ops = {
> --
> 2.34.1
>
More information about the Intel-xe
mailing list