Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171220093545.613-3-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

+9
+1
drivers/gpu/drm/drm_fb_helper.c
··· 1896 1896 if (ret < 0) 1897 1897 return ret; 1898 1898 1899 + strcpy(fb_helper->fb->comm, "[fbcon]"); 1899 1900 return 0; 1900 1901 } 1901 1902
+2
drivers/gpu/drm/drm_framebuffer.c
··· 664 664 INIT_LIST_HEAD(&fb->filp_head); 665 665 666 666 fb->funcs = funcs; 667 + strcpy(fb->comm, current->comm); 667 668 668 669 ret = __drm_mode_object_add(dev, &fb->base, DRM_MODE_OBJECT_FB, 669 670 false, drm_framebuffer_free); ··· 979 978 struct drm_format_name_buf format_name; 980 979 unsigned int i; 981 980 981 + drm_printf_indent(p, indent, "allocated by = %s\n", fb->comm); 982 982 drm_printf_indent(p, indent, "refcount=%u\n", 983 983 drm_framebuffer_read_refcount(fb)); 984 984 drm_printf_indent(p, indent, "format=%s\n",
+6
include/drm/drm_framebuffer.h
··· 121 121 * @base: base modeset object structure, contains the reference count. 122 122 */ 123 123 struct drm_mode_object base; 124 + 125 + /** 126 + * @comm: Name of the process allocating the fb, used for fb dumping. 127 + */ 128 + char comm[TASK_COMM_LEN]; 129 + 124 130 /** 125 131 * @format: framebuffer format information 126 132 */