[PATCH v2 7/7] drm/xe/bo: Allow eviction of unbound local bos
Matthew Brost
matthew.brost at intel.com
Fri Mar 22 18:52:57 UTC 2024
On Fri, Mar 22, 2024 at 10:02:13AM +0100, Thomas Hellström wrote:
> Local bos that don't have any gpu_vmas set up are allowed
> to be evicted. Support that.
>
> Fixes: 24f947d58fe5 ("drm/xe: Use DRM GPUVM helpers for external- and evicted objects")
> Cc: Thomas Hellström <thomas.hellstrom at linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi at intel.com>
> Cc: Matthew Brost <matthew.brost at intel.com>
Reviewed-by: Matthew Brost <matthew.brost at intel.com>
> Cc: Lucas De Marchi <lucas.demarchi at intel.com>
> Cc: Oded Gabbay <ogabbay at kernel.org>
> Signed-off-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>
> ---
> drivers/gpu/drm/xe/xe_bo.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/xe/xe_bo.c b/drivers/gpu/drm/xe/xe_bo.c
> index db4cd1da8ef3..87e6aff52ca6 100644
> --- a/drivers/gpu/drm/xe/xe_bo.c
> +++ b/drivers/gpu/drm/xe/xe_bo.c
> @@ -1029,10 +1029,14 @@ static bool xe_bo_eviction_valuable(struct ttm_buffer_object *ttm_bo,
> if (vm && !drm_gpuvm_is_extobj(&vm->gpuvm, &ttm_bo->base) &&
> vm->is_validating) {
> xe_vm_assert_held(vm);
> + /* Not bound to the vm? */
> + if (list_empty(&ttm_bo->base.gpuva.list))
> + goto allow;
> return false;
> }
> }
>
> +allow:
> return ttm_bo_eviction_valuable(ttm_bo, place);
> }
>
> --
> 2.44.0
>
More information about the Intel-xe
mailing list