From e86c44c4c92ba4a30ef775d6d713e7dc50ca20fa Mon Sep 17 00:00:00 2001 From: Tejas Upadhyay Date: Thu, 3 Sep 2026 21:45:58 +0530 Subject: [PATCH] drm/xe/bo: Make xe_bo_is_user() public Export xe_bo_is_user() so it can be used by the VRAM page offline code to distinguish user-created BOs from kernel BOs when deciding whether a faulty page can be safely purged or requires a full reset. Reviewed-by: Andi Shyti Reviewed-by: Himal Prasad Ghimiray Signed-off-by: Tejas Upadhyay Signed-off-by: Matthew Brost Link: https://patch.msgid.link/20260903161553.528932-22-tejas.upadhyay@intel.com --- drivers/gpu/drm/xe/xe_bo.c | 8 +++++++- drivers/gpu/drm/xe/xe_bo.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c index d30a8411d2a3..c255327669da 100644 --- a/drivers/gpu/drm/xe/xe_bo.c +++ b/drivers/gpu/drm/xe/xe_bo.c @@ -161,7 +161,13 @@ bool xe_bo_is_vm_bound(struct xe_bo *bo) return !list_empty(&bo->ttm.base.gpuva.list); } -static bool xe_bo_is_user(struct xe_bo *bo) +/** + * xe_bo_is_user - Check if BO is user-created + * @bo: The BO + * + * Returns: true if @bo was created by userspace + */ +bool xe_bo_is_user(struct xe_bo *bo) { return bo->flags & XE_BO_FLAG_USER; } diff --git a/drivers/gpu/drm/xe/xe_bo.h b/drivers/gpu/drm/xe/xe_bo.h index 90b15fff36c7..eede678ad303 100644 --- a/drivers/gpu/drm/xe/xe_bo.h +++ b/drivers/gpu/drm/xe/xe_bo.h @@ -601,6 +601,7 @@ long xe_bo_shrink(struct ttm_operation_ctx *ctx, struct ttm_buffer_object *bo, const struct xe_bo_shrink_flags flags, unsigned long *scanned); int xe_ttm_bo_purge(struct ttm_buffer_object *ttm_bo, struct ttm_operation_ctx *ctx); +bool xe_bo_is_user(struct xe_bo *bo); /** * xe_bo_is_mem_type - Whether the bo currently resides in the given