From: Ben Widawsky <ben@bwidawsk.net>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
DRI Development <dri-devel@lists.freedesktop.org>,
David Herrmann <dh.herrmann@gmail.com>
Subject: Re: [PATCH 2/2] drm/i915: use drm_mm_remove_node instead of put_block
Date: Mon, 1 Jul 2013 13:46:09 -0700 [thread overview]
Message-ID: <20130701204609.GI4242@bwidawsk.net> (raw)
In-Reply-To: <20130701203903.GE18285@phenom.ffwll.local>
On Mon, Jul 01, 2013 at 10:39:03PM +0200, Daniel Vetter wrote:
> On Mon, Jul 01, 2013 at 10:21:57PM +0200, David Herrmann wrote:
> > Hi
> >
> > On Mon, Jul 1, 2013 at 10:05 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > > When converting to the preallocated drm_mm_node interfaces in
> > >
> > > commit dc9dd7a20fde95aa81a8307cde79c2dff9f83f3d
> > > Author: Chris Wilson <chris@chris-wilson.co.uk>
> > > Date: Fri Dec 7 20:37:07 2012 +0000
> > >
> > > drm/i915: Preallocate the drm_mm_node prior to manipulating the GTT drm_mm
> > >
> > > only the allocation side was converted, but not the freeing. Fix this
> > > up.
> > >
> > > Note that the only difference between put_block and remove_node is
> > > that the former fills up the preallocation cache. Which we don't need
> > > anyway and hence is just wasted space.
> > >
> > > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > > Cc: Ben Widawsky <ben@bwidawsk.net>
> > > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > > ---
> > > drivers/gpu/drm/i915/i915_gem.c | 6 +++---
> > > 1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> > > index 4200c32..30fd694 100644
> > > --- a/drivers/gpu/drm/i915/i915_gem.c
> > > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > > @@ -2620,7 +2620,7 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj)
> > > /* Avoid an unnecessary call to unbind on rebind. */
> > > obj->map_and_fenceable = true;
> > >
> > > - drm_mm_put_block(obj->gtt_space);
> > > + drm_mm_remove_node(obj->gtt_space);
> >
> > kfree(obj->gtt_space);
> >
> > > obj->gtt_space = NULL;
> > > obj->gtt_offset = 0;
> > >
> > > @@ -3137,14 +3137,14 @@ search_free:
> > > }
> > > if (WARN_ON(!i915_gem_valid_gtt_space(dev, node, obj->cache_level))) {
> > > i915_gem_object_unpin_pages(obj);
> > > - drm_mm_put_block(node);
> > > + drm_mm_remove_node(node);
> >
> > kfree(node);
> >
> > > return -EINVAL;
> > > }
> > >
> > > ret = i915_gem_gtt_prepare_object(obj);
> > > if (ret) {
> > > i915_gem_object_unpin_pages(obj);
> > > - drm_mm_put_block(node);
> > > + drm_mm_remove_node(node);
> >
> > kfree(node);
>
> Yeah, I fail ...
>
> > drm_mm_remove_node() does unlink the node but not remove it. Btw., I
> > have these fixes in my series, too. I will push it later and write the
> > git-link to #dri-devel.
>
> We have patches in-flight to convert over to embedded drm_mm_nodes anyway,
> so I guess that part will solve itself automatically.
> -Daniel
I'm planning to get this out ASAP. I'm a bit confused now though what I
actually need to send.
--
Ben Widawsky, Intel Open Source Technology Center
next prev parent reply other threads:[~2013-07-01 20:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-01 20:05 [PATCH 1/2] drm/mm: kill color_search_free/get_block Daniel Vetter
2013-07-01 20:05 ` [PATCH 2/2] drm/i915: use drm_mm_remove_node instead of put_block Daniel Vetter
2013-07-01 20:16 ` Chris Wilson
2013-07-01 20:28 ` Daniel Vetter
2013-07-01 20:21 ` David Herrmann
2013-07-01 20:39 ` Daniel Vetter
2013-07-01 20:46 ` Ben Widawsky [this message]
2013-07-01 20:49 ` Daniel Vetter
2013-07-01 20:18 ` [PATCH 1/2] drm/mm: kill color_search_free/get_block Chris Wilson
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=20130701204609.GI4242@bwidawsk.net \
--to=ben@bwidawsk.net \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel@ffwll.ch \
--cc=dh.herrmann@gmail.com \
--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.