Skip to content

Commit 373f27f

Browse files
committed
drm/i915/gt: Prevent allocation on a banned context
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 <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 130a95e commit 373f27f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/gpu/drm/i915/gt/intel_context.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ int intel_context_alloc_state(struct intel_context *ce)
5151
return -EINTR;
5252

5353
if (!test_bit(CONTEXT_ALLOC_BIT, &ce->flags)) {
54+
if (intel_context_is_banned(ce)) {
55+
err = -EIO;
56+
goto unlock;
57+
}
58+
5459
err = ce->ops->alloc(ce);
5560
if (unlikely(err))
5661
goto unlock;

0 commit comments

Comments
 (0)