diff options
| -rw-r--r-- | drivers/gpu/drm/i915/i915_gem_context.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 5bf96a258509..e304dcbc6042 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c | |||
| @@ -106,14 +106,9 @@ static void lut_close(struct i915_gem_context *ctx) | |||
| 106 | 106 | ||
| 107 | radix_tree_for_each_slot(slot, &ctx->handles_vma, &iter, 0) { | 107 | radix_tree_for_each_slot(slot, &ctx->handles_vma, &iter, 0) { |
| 108 | struct i915_vma *vma = rcu_dereference_raw(*slot); | 108 | struct i915_vma *vma = rcu_dereference_raw(*slot); |
| 109 | struct drm_i915_gem_object *obj = vma->obj; | ||
| 110 | 109 | ||
| 111 | radix_tree_iter_delete(&ctx->handles_vma, &iter, slot); | 110 | radix_tree_iter_delete(&ctx->handles_vma, &iter, slot); |
| 112 | 111 | __i915_gem_object_release_unless_active(vma->obj); | |
| 113 | if (!i915_vma_is_ggtt(vma)) | ||
| 114 | i915_vma_close(vma); | ||
| 115 | |||
| 116 | __i915_gem_object_release_unless_active(obj); | ||
| 117 | } | 112 | } |
| 118 | } | 113 | } |
| 119 | 114 | ||
| @@ -198,6 +193,11 @@ static void context_close(struct i915_gem_context *ctx) | |||
| 198 | { | 193 | { |
| 199 | i915_gem_context_set_closed(ctx); | 194 | i915_gem_context_set_closed(ctx); |
| 200 | 195 | ||
| 196 | /* | ||
| 197 | * The LUT uses the VMA as a backpointer to unref the object, | ||
| 198 | * so we need to clear the LUT before we close all the VMA (inside | ||
| 199 | * the ppgtt). | ||
| 200 | */ | ||
| 201 | lut_close(ctx); | 201 | lut_close(ctx); |
| 202 | if (ctx->ppgtt) | 202 | if (ctx->ppgtt) |
| 203 | i915_ppgtt_close(&ctx->ppgtt->base); | 203 | i915_ppgtt_close(&ctx->ppgtt->base); |
