Skip to content

Commit

Permalink
drm/i915/gt: Prevent allocation on a banned context
Browse files Browse the repository at this point in the history
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 <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200303080546.1140508-2-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Mar 3, 2020
1 parent 130a95e commit 373f27f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/gpu/drm/i915/gt/intel_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 373f27f

Please sign in to comment.