Skip to content

Commit

Permalink
drm/i915: Balance context pinning on reset cleanup
Browse files Browse the repository at this point in the history
We pin when we submit to execlist queue. Balance
the pinning when the submitted queue is cleaned on reset.

Cc: Dave Gordon <david.s.gordon@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Thomas Daniel <thomas.daniel@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Mika Kuoppala authored and Daniel Vetter committed Jan 27, 2015
1 parent 08e16dc commit 1197b4f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2656,6 +2656,10 @@ static void i915_gem_reset_ring_cleanup(struct drm_i915_private *dev_priv,
execlist_link);
list_del(&submit_req->execlist_link);
intel_runtime_pm_put(dev_priv);

if (submit_req->ctx != ring->default_context)
intel_lr_context_unpin(ring, submit_req->ctx);

i915_gem_context_unreference(submit_req->ctx);
kfree(submit_req);
}
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/i915/intel_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1751,6 +1751,7 @@ void intel_lr_context_free(struct intel_context *ctx)
intel_unpin_ringbuffer_obj(ringbuf);
i915_gem_object_ggtt_unpin(ctx_obj);
}
WARN_ON(ctx->engine[ring->id].unpin_count);
intel_destroy_ringbuffer_obj(ringbuf);
kfree(ringbuf);
drm_gem_object_unreference(&ctx_obj->base);
Expand Down

0 comments on commit 1197b4f

Please sign in to comment.