intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/selftests/perf: watch out for stolen objects
@ 2020-03-23 11:03 Matthew Auld
  2020-03-23 11:08 ` Chris Wilson
  2020-03-23 13:05 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Matthew Auld @ 2020-03-23 11:03 UTC (permalink / raw)
  To: intel-gfx

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>
---
 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);
 		return obj;
+	}
 
 	addr = i915_gem_object_pin_map(obj, type);
 	if (IS_ERR(addr)) {
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915/selftests/perf: watch out for stolen objects
  2020-03-23 11:03 [Intel-gfx] [PATCH] drm/i915/selftests/perf: watch out for stolen objects Matthew Auld
@ 2020-03-23 11:08 ` Chris Wilson
  2020-03-23 13:05 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2020-03-23 11:08 UTC (permalink / raw)
  To: Matthew Auld, intel-gfx

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@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@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Intel-gfx] ✗ Fi.CI.BAT: failure for drm/i915/selftests/perf: watch out for stolen objects
  2020-03-23 11:03 [Intel-gfx] [PATCH] drm/i915/selftests/perf: watch out for stolen objects Matthew Auld
  2020-03-23 11:08 ` Chris Wilson
@ 2020-03-23 13:05 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2020-03-23 13:05 UTC (permalink / raw)
  To: Matthew Auld; +Cc: intel-gfx

== 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
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-23 13:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-23 11:03 [Intel-gfx] [PATCH] drm/i915/selftests/perf: watch out for stolen objects Matthew Auld
2020-03-23 11:08 ` Chris Wilson
2020-03-23 13:05 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).