[Intel-gfx] [PATCH] drm/i915: Report correct GGTT space usage

Chris Wilson chris at chris-wilson.co.uk
Tue Jun 30 03:01:44 PDT 2015


On Tue, Jun 30, 2015 at 10:50:15AM +0100, Tvrtko Ursulin wrote:
> 
> On 06/30/2015 10:36 AM, Chris Wilson wrote:
> >On Tue, Jun 30, 2015 at 10:28:02AM +0100, Tvrtko Ursulin wrote:
> >>diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> >>index a2a4a27..7d69294 100644
> >>--- a/drivers/gpu/drm/i915/i915_gem.c
> >>+++ b/drivers/gpu/drm/i915/i915_gem.c
> >>@@ -156,7 +156,7 @@ i915_gem_get_aperture_ioctl(struct drm_device *dev, void *data,
> >>  	mutex_lock(&dev->struct_mutex);
> >>  	list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list)
> >>  		if (i915_gem_obj_is_pinned(obj))
> >>-			pinned += i915_gem_obj_ggtt_size(obj);
> >>+			pinned += i915_gem_obj_total_ggtt_size(obj);
> >
> >Please just rewrite this as a single vma walk, or review the patches I
> >sent to do so.
> 
> Sorry there is a lot of patches floating around and I don't know
> which ones you refer too.
> 
> I just noticed debugfs displays wrong values when GGTT views other
> than normal are present.
> 
> So just open code the loop in get_aperture you say?

Yes.
 
> It is slightly ugly when there are helpers, but it is also true
> different callers want to know slightly different things.
> (Difference between GGTT usage reported in get_aperture vs debugfs -
> pinned or just allocated.)

I've stopped taking notice of the GGTT usage in the debugfs output, it's
archaic and doesn't help me anymore. The only case where it really
matters is debugfs/i915_gem_gtt.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list