drm: spiff out FB refcnting traces
authorRob Clark <robdclark@gmail.com>
Tue, 18 Mar 2014 14:07:08 +0000 (10:07 -0400)
committerDave Airlie <airlied@redhat.com>
Wed, 4 Jun 2014 03:23:20 +0000 (13:23 +1000)
I find myself making this change locally whenever debugging FB reference
counting.  Which seems a bit silly.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: David Herrmann <dh.herrmann@gmail.com>
drivers/gpu/drm/drm_crtc.c

index 6127073..5b3e292 100644 (file)
@@ -513,7 +513,7 @@ EXPORT_SYMBOL(drm_framebuffer_lookup);
  */
 void drm_framebuffer_unreference(struct drm_framebuffer *fb)
 {
-       DRM_DEBUG("FB ID: %d\n", fb->base.id);
+       DRM_DEBUG("%p: FB ID: %d (%d)\n", fb, fb->base.id, atomic_read(&fb->refcount.refcount));
        kref_put(&fb->refcount, drm_framebuffer_free);
 }
 EXPORT_SYMBOL(drm_framebuffer_unreference);
@@ -526,7 +526,7 @@ EXPORT_SYMBOL(drm_framebuffer_unreference);
  */
 void drm_framebuffer_reference(struct drm_framebuffer *fb)
 {
-       DRM_DEBUG("FB ID: %d\n", fb->base.id);
+       DRM_DEBUG("%p: FB ID: %d (%d)\n", fb, fb->base.id, atomic_read(&fb->refcount.refcount));
        kref_get(&fb->refcount);
 }
 EXPORT_SYMBOL(drm_framebuffer_reference);
@@ -538,7 +538,7 @@ static void drm_framebuffer_free_bug(struct kref *kref)
 
 static void __drm_framebuffer_unreference(struct drm_framebuffer *fb)
 {
-       DRM_DEBUG("FB ID: %d\n", fb->base.id);
+       DRM_DEBUG("%p: FB ID: %d (%d)\n", fb, fb->base.id, atomic_read(&fb->refcount.refcount));
        kref_put(&fb->refcount, drm_framebuffer_free_bug);
 }