Re: [Intel-gfx] [PATCH 05/12] drm/i915/gt: Prevent allocation on a banned context

2020-02-18 Thread Matthew Auld
On Tue, 18 Feb 2020 at 16:22, Chris Wilson  wrote:
>
> If a context is banned even before we submit our first request to it,
> report the failure before we attempt to allocate any resources for the
> context.
>
> Signed-off-by: Chris Wilson 
Reviewed-by: Matthew Auld 
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 05/12] drm/i915/gt: Prevent allocation on a banned context

2020-02-18 Thread Chris Wilson
If a context is banned even before we submit our first request to it,
report the failure before we attempt to allocate any resources for the
context.

Signed-off-by: Chris Wilson 
---
 drivers/gpu/drm/i915/gt/intel_context.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_context.c 
b/drivers/gpu/drm/i915/gt/intel_context.c
index 8bb444cda14f..01474d3a558b 100644
--- a/drivers/gpu/drm/i915/gt/intel_context.c
+++ b/drivers/gpu/drm/i915/gt/intel_context.c
@@ -51,6 +51,11 @@ int intel_context_alloc_state(struct intel_context *ce)
return -EINTR;
 
if (!test_bit(CONTEXT_ALLOC_BIT, &ce->flags)) {
+   if (intel_context_is_banned(ce)) {
+   err = -EIO;
+   goto unlock;
+   }
+
err = ce->ops->alloc(ce);
if (unlikely(err))
goto unlock;
-- 
2.25.0

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