Skip to contentSkip to conversation

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

PATCH In review Matthew Auld 3 participants 3 messages Mar 23, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

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

---
 drivers/gpu/drm/i915/selftests/intel_memory_region.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/selftests/intel_memory_region.c +4 -1
index 2a1d4ba1f9f3..6e80d99048e4 100644
@@ -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);
 		return obj;
+	}
 
 	addr = i915_gem_object_pin_map(obj, type);
 	if (IS_ERR(addr)) {
Signature · 6 lines
2.20.1

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/1
#1 lore raw

Quoting Matthew Auld (2020-03-23 11:03:01)

Quoted 2 lines

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.

Quoted 11 lines
---
 drivers/gpu/drm/i915/selftests/intel_memory_region.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/selftests/intel_memory_region.c +0 -0
index 2a1d4ba1f9f3..6e80d99048e4 100644

drivers/gpu/drm/i915/selftests/intel_memory_region.c create_region_for_mapping(struct intel_memory_region *mr, u64 size, u32 type, · line 599

Quoted 7 lines
drivers/gpu/drm/i915/selftests/intel_memory_region.c +3 -1
@@ -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.

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw

[Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/selftests/perf: watch out for stolen objects

In reply to Matthew Auld
== Series Details ==

== Series Details ==

Series: drm/i915/selftests/perf: watch out for stolen objects
URL : https://patchwork.freedesktop.org/series/74968/
State : failure

== Summary ==

Applying: drm/i915/selftests/perf: watch out for stolen objects Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/selftests/intel_memory_region.c
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx