Skip to content

Commit e2c56d8

Browse files
icklejlahtine-intel
authored andcommitted
drm/i915/gt: Mark context->state vma as active while pinned
As we use the active state to keep the vma alive while we are reading its contents during GPU error capture, we need to mark the context->state vma as active during execution if we want to include it in the error state. Reported-by: Lionel Landwerlin <[email protected]> Fixes: b1e3177 ("drm/i915: Coordinate i915_active with its own mutex") Signed-off-by: Chris Wilson <[email protected]> Cc: Tvrtko Ursulin <[email protected]> Cc: Lionel Landwerlin <[email protected]> Acked-by: Lionel Landwerlin <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 1b8bfc5) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent c3866f5 commit e2c56d8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,10 @@ static int __context_pin_state(struct i915_vma *vma)
123123
if (err)
124124
return err;
125125

126+
err = i915_active_acquire(&vma->active);
127+
if (err)
128+
goto err_unpin;
129+
126130
/*
127131
* And mark it as a globally pinned object to let the shrinker know
128132
* it cannot reclaim the object until we release it.
@@ -131,11 +135,16 @@ static int __context_pin_state(struct i915_vma *vma)
131135
vma->obj->mm.dirty = true;
132136

133137
return 0;
138+
139+
err_unpin:
140+
i915_vma_unpin(vma);
141+
return err;
134142
}
135143

136144
static void __context_unpin_state(struct i915_vma *vma)
137145
{
138146
i915_vma_make_shrinkable(vma);
147+
i915_active_release(&vma->active);
139148
__i915_vma_unpin(vma);
140149
}
141150

0 commit comments

Comments
 (0)