Re: [PATCH] drm/i915: Report correct GGTT space usage

Tvrtko Ursulin
2015-06-30T09:50:16Z

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?

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.)

Regards,

Tvrtko