drm/i915/selftests/perf: watch out for stolen objects

Stolen memory is allocated at creation, returning -ENOSPC if we run out
space.

Closes: https://gitlab.freedesktop.org/drm/intel/issues/1424
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20200323110301.38806-1-matthew.auld@intel.com
This commit is contained in:
Matthew Auld 2020-03-23 11:03:01 +00:00 committed by Chris Wilson
parent 41e4065a6b
commit 45d4173994

View File

@ -594,8 +594,11 @@ create_region_for_mapping(struct intel_memory_region *mr, u64 size, u32 type,
void *addr; void *addr;
obj = i915_gem_object_create_region(mr, size, 0); 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);
return obj; return obj;
}
addr = i915_gem_object_pin_map(obj, type); addr = i915_gem_object_pin_map(obj, type);
if (IS_ERR(addr)) { if (IS_ERR(addr)) {