[Intel-gfx] [PATCH 2/2] drm/i915: unreference default context on module unload

Mika Kuoppala mika.kuoppala at linux.intel.com
Tue Apr 30 12:30:34 CEST 2013


Before module unload is called, gpu_idle() will switch
to default context. This will increment ref count of base
object as the default context is 'running' on module unload
time. Unreference the drm object so that when context
is freed, base object is freed as well.

Signed-off-by: Mika Kuoppala <mika.kuoppala at intel.com>
---
 drivers/gpu/drm/i915/i915_gem_context.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c
index 9e8c685..30f7f4c 100644
--- a/drivers/gpu/drm/i915/i915_gem_context.c
+++ b/drivers/gpu/drm/i915/i915_gem_context.c
@@ -274,6 +274,7 @@ void i915_gem_context_fini(struct drm_device *dev)
 	intel_gpu_reset(dev);
 
 	i915_gem_object_unpin(dctx->obj);
+	drm_gem_object_unreference(&dctx->obj->base);
 	i915_gem_context_unreference(dctx);
 }
 
-- 
1.7.9.5




More information about the Intel-gfx mailing list