Commit 8d44e9e6 authored by Maarten Lankhorst's avatar Maarten Lankhorst

drm/framebuffer: Print task that allocated the fb in debug info.

This is is very useful to finding sources of leaked framebufers.
The fbcon fb is annotated with [fbcon], to give it a better name
than kworker.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171220093545.613-3-maarten.lankhorst@linux.intel.comReviewed-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 48c9571c
...@@ -1896,6 +1896,7 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, ...@@ -1896,6 +1896,7 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
if (ret < 0) if (ret < 0)
return ret; return ret;
strcpy(fb_helper->fb->comm, "[fbcon]");
return 0; return 0;
} }
......
...@@ -664,6 +664,7 @@ int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb, ...@@ -664,6 +664,7 @@ int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb,
INIT_LIST_HEAD(&fb->filp_head); INIT_LIST_HEAD(&fb->filp_head);
fb->funcs = funcs; fb->funcs = funcs;
strcpy(fb->comm, current->comm);
ret = __drm_mode_object_add(dev, &fb->base, DRM_MODE_OBJECT_FB, ret = __drm_mode_object_add(dev, &fb->base, DRM_MODE_OBJECT_FB,
false, drm_framebuffer_free); false, drm_framebuffer_free);
...@@ -978,6 +979,7 @@ void drm_framebuffer_print_info(struct drm_printer *p, unsigned int indent, ...@@ -978,6 +979,7 @@ void drm_framebuffer_print_info(struct drm_printer *p, unsigned int indent,
struct drm_format_name_buf format_name; struct drm_format_name_buf format_name;
unsigned int i; unsigned int i;
drm_printf_indent(p, indent, "allocated by = %s\n", fb->comm);
drm_printf_indent(p, indent, "refcount=%u\n", drm_printf_indent(p, indent, "refcount=%u\n",
drm_framebuffer_read_refcount(fb)); drm_framebuffer_read_refcount(fb));
drm_printf_indent(p, indent, "format=%s\n", drm_printf_indent(p, indent, "format=%s\n",
......
...@@ -121,6 +121,12 @@ struct drm_framebuffer { ...@@ -121,6 +121,12 @@ struct drm_framebuffer {
* @base: base modeset object structure, contains the reference count. * @base: base modeset object structure, contains the reference count.
*/ */
struct drm_mode_object base; struct drm_mode_object base;
/**
* @comm: Name of the process allocating the fb, used for fb dumping.
*/
char comm[TASK_COMM_LEN];
/** /**
* @format: framebuffer format information * @format: framebuffer format information
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment