Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Widawsky <benjamin.widawsky@intel.com>
To: Intel GFX <intel-gfx@lists.freedesktop.org>
Cc: Ben Widawsky <ben@bwidawsk.net>,
	Ben Widawsky <benjamin.widawsky@intel.com>
Subject: [PATCH 12/12] drm/i915: Move the gtt mm takedown to cleanup
Date: Mon, 25 Nov 2013 09:54:43 -0800	[thread overview]
Message-ID: <1385402083-8719-13-git-send-email-benjamin.widawsky@intel.com> (raw)
In-Reply-To: <1385402083-8719-1-git-send-email-benjamin.widawsky@intel.com>

Our VM code already has a cleanup function, and this is a nice place to
put the drm_mm_takedown. This should have no functional impact, it just
leaves the unload function a bit cleaer, and is more logical IMO

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_dma.c     | 1 -
 drivers/gpu/drm/i915/i915_gem_gtt.c | 2 ++
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 25acbb5..5aeb103 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1777,7 +1777,6 @@ int i915_driver_unload(struct drm_device *dev)
 
 	list_del(&dev_priv->gtt.base.global_link);
 	WARN_ON(!list_empty(&dev_priv->vm_list));
-	drm_mm_takedown(&dev_priv->gtt.base.mm);
 
 	drm_vblank_cleanup(dev);
 
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index 5ec4ba0..0560337 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -1419,6 +1419,8 @@ static void gen6_gmch_remove(struct i915_address_space *vm)
 {
 
 	struct i915_gtt *gtt = container_of(vm, struct i915_gtt, base);
+
+	drm_mm_takedown(&vm->mm);
 	iounmap(gtt->gsm);
 	teardown_scratch_page(vm->dev);
 }
-- 
1.8.4.2

      parent reply	other threads:[~2013-11-25 17:55 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-25 17:54 [PATCH 00/12] PPGTT pre-work Ben Widawsky
2013-11-25 17:54 ` [PATCH 01/12] drm/i915: Fix BDW PPGTT error path Ben Widawsky
2013-11-25 20:11   ` Chris Wilson
2013-11-25 17:54 ` [PATCH 02/12] drm/i915: Provide PDP updates via MMIO Ben Widawsky
2013-11-25 18:00   ` Ben Widawsky
2013-11-25 18:18   ` Chris Wilson
2013-11-25 18:28     ` Ben Widawsky
2013-11-25 18:44       ` Chris Wilson
2013-11-25 18:49         ` Ben Widawsky
2013-11-26  9:05   ` Daniel Vetter
2013-11-25 17:54 ` [PATCH 03/12] drm/i915: Add a few missed bits to the mm Ben Widawsky
2013-11-25 17:54 ` [PATCH 04/12] drm/i915: Don't unconditionally try to deref aliasing ppgtt Ben Widawsky
2013-11-25 18:06   ` Chris Wilson
2013-11-25 18:10     ` Ben Widawsky
2013-11-25 19:08       ` Ville Syrjälä
2013-11-26  9:09         ` Daniel Vetter
2013-11-25 17:54 ` [PATCH 05/12] drm/i915: Disallow dynamic ppgtt param modification Ben Widawsky
2013-11-25 18:50   ` Chris Wilson
2013-11-25 17:54 ` [PATCH 06/12] drm/i915: Demote drop_caches_set print Ben Widawsky
2013-11-25 18:08   ` Chris Wilson
2013-11-25 17:54 ` [PATCH 07/12] drm/i915: Removed unused vm args Ben Widawsky
2013-11-25 17:54 ` [PATCH 08/12] drm/i915: Remove defunct ctx switch comments Ben Widawsky
2013-11-25 17:54 ` [PATCH 09/12] drm/i915: Missed dropped VMA conversion Ben Widawsky
2013-11-25 17:54 ` [PATCH 10/12] drm/i915: Allow ggtt lookups to not WARN Ben Widawsky
2013-11-26  9:16   ` Daniel Vetter
2013-11-25 17:54 ` [PATCH 11/12] drm/i915: Takedown drm_mm on failed gtt setup Ben Widawsky
2013-11-26  9:21   ` Daniel Vetter
2013-11-25 17:54 ` Ben Widawsky [this message]

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=1385402083-8719-13-git-send-email-benjamin.widawsky@intel.com \
    --to=benjamin.widawsky@intel.com \
    --cc=ben@bwidawsk.net \
    --cc=intel-gfx@lists.freedesktop.org \
    /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