diff options
author | Thomas Daniel <thomas.daniel@intel.com> | 2014-11-25 10:39:25 +0000 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-12-03 09:29:41 +0100 |
commit | 0794aed3028544e10997e14aa7685ec10a5b4203 (patch) | |
tree | 05d6063804e936a94f9eff493817387cbf4d286f /drivers/gpu | |
parent | 8ee558d8041f3facc79a13242c624c2ca87626e7 (diff) | |
download | linux-0794aed3028544e10997e14aa7685ec10a5b4203.tar.gz linux-0794aed3028544e10997e14aa7685ec10a5b4203.tar.bz2 linux-0794aed3028544e10997e14aa7685ec10a5b4203.zip |
drm/i915: Fix context object leak for legacy contexts
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>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 97b86a55e138..d2ba315f4c92 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -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); |