From: Daniel Vetter <daniel@ffwll.ch>
To: Intel Graphics Development <intel-gfx@lists.freedesktop.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Don't try to tear down the stolen drm_mm if it's not there
Date: Tue, 2 Jul 2013 09:59:44 +0200 [thread overview]
Message-ID: <20130702075944.GL18285@phenom.ffwll.local> (raw)
In-Reply-To: <1372710870-4329-1-git-send-email-daniel.vetter@ffwll.ch>
On Mon, Jul 01, 2013 at 10:34:30PM +0200, Daniel Vetter wrote:
> Every other place properly checks whether we've managed to set
> up the stolen allocator at boot-up properly, with the exception
> of the cleanup code. Which results in an ugly
>
> *ERROR* Memory manager not clean. Delaying takedown
>
> at module unload time since the drm_mm isn't initialized at all.
>
> v2: While at it check whether the stolen drm_mm is initialized instead
> of the more obscure stolen_base == 0 check.
>
> v3: Fix up the logic. Also we need to keep the stolen_base check in
> i915_gem_object_create_stolen_for_preallocated since that can be
> called before stolen memory is fully set up. Spotted by Chris Wilson.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65953
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Tested-by: lu hua <huax.lu@intel.com>
> ---
> drivers/gpu/drm/i915/i915_gem_stolen.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c
> index 8e02344..fbfc2c7 100644
> --- a/drivers/gpu/drm/i915/i915_gem_stolen.c
> +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
> @@ -147,7 +147,7 @@ int i915_gem_stolen_setup_compression(struct drm_device *dev, int size)
> {
> struct drm_i915_private *dev_priv = dev->dev_private;
>
> - if (dev_priv->mm.stolen_base == 0)
> + if (!drm_mm_initialized(&dev_priv->mm.stolen))
> return -ENODEV;
>
> if (size < dev_priv->fbc.size)
> @@ -179,6 +179,9 @@ void i915_gem_cleanup_stolen(struct drm_device *dev)
> {
> struct drm_i915_private *dev_priv = dev->dev_private;
>
> + if (!drm_mm_initialized(&dev_priv->mm.stolen))
> + return;
> +
> i915_gem_stolen_cleanup_compression(dev);
> drm_mm_takedown(&dev_priv->mm.stolen);
> }
> @@ -300,7 +303,7 @@ i915_gem_object_create_stolen(struct drm_device *dev, u32 size)
> struct drm_i915_gem_object *obj;
> struct drm_mm_node *stolen;
>
> - if (dev_priv->mm.stolen_base == 0)
> + if (!drm_mm_initialized(&dev_priv->mm.stolen))
> return NULL;
>
> DRM_DEBUG_KMS("creating stolen object: size=%x\n", size);
> --
> 1.8.3.1
>
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2013-07-02 7:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-01 20:01 [PATCH 1/3] drm/mm: fix debug table BUG Daniel Vetter
2013-07-01 20:01 ` [PATCH 2/3] drm/i915: Don't try to tear down the stolen drm_mm if it's not there Daniel Vetter
2013-07-01 20:13 ` Chris Wilson
2013-07-01 20:34 ` [PATCH] " Daniel Vetter
2013-07-02 7:54 ` Chris Wilson
2013-07-02 7:58 ` [Intel-gfx] " Daniel Vetter
2013-07-02 8:13 ` Chris Wilson
2013-07-02 8:41 ` Daniel Vetter
2013-07-02 8:48 ` Daniel Vetter
2013-07-02 9:25 ` Chris Wilson
2013-07-02 9:48 ` Daniel Vetter
2013-07-02 7:59 ` Daniel Vetter [this message]
2013-07-01 20:01 ` [PATCH 3/3] drm/mm: WARN for unclean mm takedown Daniel Vetter
2013-07-02 3:09 ` [Intel-gfx] " Ben Widawsky
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=20130702075944.GL18285@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.