summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorNoralf Trønnes <noralf@tronnes.org>2017-11-07 22:13:39 +0300
committerNoralf Trønnes <noralf@tronnes.org>2017-11-11 13:20:32 +0300
commitbf6234a294c5b8bcc6f47ecdb646f41ad5efddd3 (patch)
tree91b065ae23a60e57616032738034a7d31e9fb632 /include/drm
parent6ff1086e21e5b1d6239e2c47267d21dc19b6e801 (diff)
downloadlinux-bf6234a294c5b8bcc6f47ecdb646f41ad5efddd3.tar.xz
drm/print: Add drm_printf_indent()
Add drm_printf_indent() that adds tab indentation according to argument. Indentation overflow is marked with an X. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Noralf Trønnes <noralf@tronnes.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171107191348.17555-4-noralf@tronnes.org
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_print.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index 7b9c86a6ca3e..7dbfdebec973 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -80,6 +80,14 @@ void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf);
__printf(2, 3)
void drm_printf(struct drm_printer *p, const char *f, ...);
+/**
+ * drm_printf_indent - Print to a &drm_printer stream with indentation
+ * @printer: DRM printer
+ * @indent: Tab indentation level (max 5)
+ * @fmt: Format string
+ */
+#define drm_printf_indent(printer, indent, fmt, ...) \
+ drm_printf((printer), "%.*s" fmt, (indent), "\t\t\t\t\tX", ##__VA_ARGS__)
/**
* drm_seq_file_printer - construct a &drm_printer that outputs to &seq_file