Skip to content

Commit

Permalink
drm/i915: Fix context object leak for legacy contexts
Browse files Browse the repository at this point in the history
Dynamic context pinning for LRCs introduced a leak in legacy mode.
Reinstate context unreference in i915_gem_free_request for legacy contexts.

Leak reported by i-g-t/drv_module_reload fixed by this patch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86507
Signed-off-by: Thomas Daniel <thomas.daniel@intel.com>
Reviewed-by: John Harrison<John.C.Harrison@Intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Thomas Daniel authored and Daniel Vetter committed Dec 3, 2014
1 parent 8ee558d commit 0794aed
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -2574,11 +2574,13 @@ static void i915_gem_free_request(struct drm_i915_gem_request *request)
list_del(&request->list);
i915_gem_request_remove_from_client(request);

if (i915.enable_execlists && ctx) {
struct intel_engine_cs *ring = request->ring;
if (ctx) {
if (i915.enable_execlists) {
struct intel_engine_cs *ring = request->ring;

if (ctx != ring->default_context)
intel_lr_context_unpin(ring, ctx);
if (ctx != ring->default_context)
intel_lr_context_unpin(ring, ctx);
}
i915_gem_context_unreference(ctx);
}
kfree(request);
Expand Down

0 comments on commit 0794aed

Please sign in to comment.