[Intel-gfx] [PATCH] drm/i915/selftests/perf: watch out for stolen objects
Chris Wilson
chris at chris-wilson.co.uk
Mon Mar 23 11:08:46 UTC 2020
Quoting Matthew Auld (2020-03-23 11:03:01)
> Stolen memory is allocated at creation, returning -ENOSPC if we run out
> space.
Sigh. Eviction was always a planned feature for stolen, for when we
exposed it to userspace. We should have just done that to flesh out the
driver APIs and uAPI.
> Closes: https://gitlab.freedesktop.org/drm/intel/issues/1424
> Signed-off-by: Matthew Auld <matthew.auld at intel.com>
> ---
> drivers/gpu/drm/i915/selftests/intel_memory_region.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/selftests/intel_memory_region.c b/drivers/gpu/drm/i915/selftests/intel_memory_region.c
> index 2a1d4ba1f9f3..6e80d99048e4 100644
> --- a/drivers/gpu/drm/i915/selftests/intel_memory_region.c
> +++ b/drivers/gpu/drm/i915/selftests/intel_memory_region.c
> @@ -594,8 +594,11 @@ create_region_for_mapping(struct intel_memory_region *mr, u64 size, u32 type,
> void *addr;
>
> obj = i915_gem_object_create_region(mr, size, 0);
> - if (IS_ERR(obj))
> + if (IS_ERR(obj)) {
> + if (PTR_ERR(obj) == -ENOSPC) /* Stolen memory */
> + return ERR_PTR(-ENODEV);
Ok, we can live with this for now.
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris
More information about the Intel-gfx
mailing list