Patchwork drm: More debug info for fb leaks in mode_config_cleanup

login
register
mail settings
Submitter Daniel Vetter
Date Dec. 7, 2017, 2:49 p.m.
Message ID <20171207144925.14191-1-daniel.vetter@ffwll.ch>
Download mbox | patch
Permalink /patch/10099351/
State New
Headers show

Comments

Daniel Vetter - Dec. 7, 2017, 2:49 p.m.
We're spotting this very rarely in CI, but have no idea. Let's add
more debug info about what's going on here.

References: https://bugs.freedesktop.org/show_bug.cgi?id=102707
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/drm_mode_config.c | 3 +++
 1 file changed, 3 insertions(+)
Noralf Trønnes - Dec. 7, 2017, 3:52 p.m.
Den 07.12.2017 15.49, skrev Daniel Vetter:
> We're spotting this very rarely in CI, but have no idea. Let's add
> more debug info about what's going on here.
>
> References: https://bugs.freedesktop.org/show_bug.cgi?id=102707
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---

Acked-by: Noralf Trønnes <noralf@tronnes.org>

>   drivers/gpu/drm/drm_mode_config.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
> index cc78b3d9e5e4..6ffe952142e6 100644
> --- a/drivers/gpu/drm/drm_mode_config.c
> +++ b/drivers/gpu/drm/drm_mode_config.c
> @@ -469,6 +469,9 @@ void drm_mode_config_cleanup(struct drm_device *dev)
>   	 */
>   	WARN_ON(!list_empty(&dev->mode_config.fb_list));
>   	list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
> +		struct drm_printer p = drm_debug_printer("[leaked fb]");
> +		drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
> +		drm_framebuffer_print_info(&p, 1, fb);
>   		drm_framebuffer_free(&fb->base.refcount);
>   	}
>
Daniel Vetter - Dec. 7, 2017, 5:47 p.m.
On Thu, Dec 07, 2017 at 04:52:04PM +0100, Noralf Trønnes wrote:
> 
> Den 07.12.2017 15.49, skrev Daniel Vetter:
> > We're spotting this very rarely in CI, but have no idea. Let's add
> > more debug info about what's going on here.
> > 
> > References: https://bugs.freedesktop.org/show_bug.cgi?id=102707
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> 
> Acked-by: Noralf Trønnes <noralf@tronnes.org>

Applied, thanks for taking a look!
-Daniel

> 
> >   drivers/gpu/drm/drm_mode_config.c | 3 +++
> >   1 file changed, 3 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
> > index cc78b3d9e5e4..6ffe952142e6 100644
> > --- a/drivers/gpu/drm/drm_mode_config.c
> > +++ b/drivers/gpu/drm/drm_mode_config.c
> > @@ -469,6 +469,9 @@ void drm_mode_config_cleanup(struct drm_device *dev)
> >   	 */
> >   	WARN_ON(!list_empty(&dev->mode_config.fb_list));
> >   	list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
> > +		struct drm_printer p = drm_debug_printer("[leaked fb]");
> > +		drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
> > +		drm_framebuffer_print_info(&p, 1, fb);
> >   		drm_framebuffer_free(&fb->base.refcount);
> >   	}
>

Patch

diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c
index cc78b3d9e5e4..6ffe952142e6 100644
--- a/drivers/gpu/drm/drm_mode_config.c
+++ b/drivers/gpu/drm/drm_mode_config.c
@@ -469,6 +469,9 @@  void drm_mode_config_cleanup(struct drm_device *dev)
 	 */
 	WARN_ON(!list_empty(&dev->mode_config.fb_list));
 	list_for_each_entry_safe(fb, fbt, &dev->mode_config.fb_list, head) {
+		struct drm_printer p = drm_debug_printer("[leaked fb]");
+		drm_printf(&p, "framebuffer[%u]:\n", fb->base.id);
+		drm_framebuffer_print_info(&p, 1, fb);
 		drm_framebuffer_free(&fb->base.refcount);
 	}