[Intel-gfx] [PATCH 25/26] drm/i915: Print used ppgtt pages for gen6 in debugfs

Chris Wilson chris at chris-wilson.co.uk
Thu Mar 20 11:09:50 CET 2014


On Mon, Mar 17, 2014 at 10:48:57PM -0700, Ben Widawsky wrote:
> Signed-off-by: Ben Widawsky <ben at bwidawsk.net>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 5f3666a..04d40fa 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1785,10 +1785,26 @@ static void gen8_ppgtt_info(struct seq_file *m, struct drm_device *dev, int verb
>  	}
>  }
>  
> +static size_t gen6_ppgtt_count_pt_pages(struct i915_hw_ppgtt *ppgtt)
> +{
> +	struct i915_pagedir *pd = &ppgtt->pd;
> +	struct i915_pagetab **pt = &pd->page_tables[0];
> +	size_t cnt = 0;
> +	int i;

How can the count be a size_t when cnt <= i  and i is only an int?

What was the reason for picking size_t here? Does that have far reaching
implications?
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list