diff mbox

[29/35] drm/i915: dump refcount into framebuffer debugfs file

Message ID 1357850897-27102-30-git-send-email-daniel.vetter@ffwll.ch (mailing list archive)
State New, archived
Headers show

Commit Message

Daniel Vetter Jan. 10, 2013, 8:48 p.m. UTC
Useful for checking whether the new refcounting works as advertised.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_debugfs.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Rob Clark Jan. 11, 2013, 10:20 p.m. UTC | #1
On Thu, Jan 10, 2013 at 2:48 PM, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> Useful for checking whether the new refcounting works as advertised.

looks useful.. I should probably add this to omapdrm and the cma
debugfs helper patch that I sent recently..

BR,
-R

> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c |   10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 1269a46..7576e78 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -1440,11 +1440,12 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
>         ifbdev = dev_priv->fbdev;
>         fb = to_intel_framebuffer(ifbdev->helper.fb);
>
> -       seq_printf(m, "fbcon size: %d x %d, depth %d, %d bpp, obj ",
> +       seq_printf(m, "fbcon size: %d x %d, depth %d, %d bpp, refcount %d, obj ",
>                    fb->base.width,
>                    fb->base.height,
>                    fb->base.depth,
> -                  fb->base.bits_per_pixel);
> +                  fb->base.bits_per_pixel,
> +                  atomic_read(&fb->base.refcount.refcount));
>         describe_obj(m, fb->obj);
>         seq_printf(m, "\n");
>         mutex_unlock(&dev->mode_config.mutex);
> @@ -1454,11 +1455,12 @@ static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
>                 if (&fb->base == ifbdev->helper.fb)
>                         continue;
>
> -               seq_printf(m, "user size: %d x %d, depth %d, %d bpp, obj ",
> +               seq_printf(m, "user size: %d x %d, depth %d, %d bpp, refcount %d, obj ",
>                            fb->base.width,
>                            fb->base.height,
>                            fb->base.depth,
> -                          fb->base.bits_per_pixel);
> +                          fb->base.bits_per_pixel,
> +                          atomic_read(&fb->base.refcount.refcount));
>                 describe_obj(m, fb->obj);
>                 seq_printf(m, "\n");
>         }
> --
> 1.7.10.4
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 1269a46..7576e78 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1440,11 +1440,12 @@  static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
 	ifbdev = dev_priv->fbdev;
 	fb = to_intel_framebuffer(ifbdev->helper.fb);
 
-	seq_printf(m, "fbcon size: %d x %d, depth %d, %d bpp, obj ",
+	seq_printf(m, "fbcon size: %d x %d, depth %d, %d bpp, refcount %d, obj ",
 		   fb->base.width,
 		   fb->base.height,
 		   fb->base.depth,
-		   fb->base.bits_per_pixel);
+		   fb->base.bits_per_pixel,
+		   atomic_read(&fb->base.refcount.refcount));
 	describe_obj(m, fb->obj);
 	seq_printf(m, "\n");
 	mutex_unlock(&dev->mode_config.mutex);
@@ -1454,11 +1455,12 @@  static int i915_gem_framebuffer_info(struct seq_file *m, void *data)
 		if (&fb->base == ifbdev->helper.fb)
 			continue;
 
-		seq_printf(m, "user size: %d x %d, depth %d, %d bpp, obj ",
+		seq_printf(m, "user size: %d x %d, depth %d, %d bpp, refcount %d, obj ",
 			   fb->base.width,
 			   fb->base.height,
 			   fb->base.depth,
-			   fb->base.bits_per_pixel);
+			   fb->base.bits_per_pixel,
+			   atomic_read(&fb->base.refcount.refcount));
 		describe_obj(m, fb->obj);
 		seq_printf(m, "\n");
 	}