Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: miku@iki.fi
Subject: [PATCH 2/2] drm/i915: unreference default context on module unload
Date: Tue, 30 Apr 2013 13:30:34 +0300	[thread overview]
Message-ID: <1367317834-11294-2-git-send-email-mika.kuoppala@intel.com> (raw)
In-Reply-To: <1367317834-11294-1-git-send-email-mika.kuoppala@intel.com>

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@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

  reply	other threads:[~2013-04-30 10:26 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-30 10:30 [PATCH 1/2] drm/i915: reference count for i915_hw_contexts Mika Kuoppala
2013-04-30 10:30 ` Mika Kuoppala [this message]
2013-04-30 15:49   ` [PATCH 2/2] drm/i915: unreference default context on module unload Ben Widawsky
2013-05-02  8:37     ` Mika Kuoppala
2013-05-02 16:10       ` Ben Widawsky
2013-05-03 13:29         ` [PATCH v2] " Mika Kuoppala
2013-05-03 15:53           ` Ben Widawsky
2013-05-03 16:22             ` Daniel Vetter
2013-04-30 18:40 ` [PATCH 1/2] drm/i915: reference count for i915_hw_contexts Ben Widawsky
2013-04-30 21:39   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1367317834-11294-2-git-send-email-mika.kuoppala@intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=miku@iki.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox