summaryrefslogtreecommitdiffstats
path: root/include/drm
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2017-11-23 08:40:46 +0000
committerJoonas Lahtinen <joonas.lahtinen@linux.intel.com>2017-11-23 12:31:49 +0200
commite2b155e9924c39c074339cf77e22a0a4cead66e0 (patch)
treefcaa71de0087f4a759f36121d1e57b1f41d6186e /include/drm
parentf1781e9bb2dd2305d8d7ffbede1888ae22119557 (diff)
downloadlinux-e2b155e9924c39c074339cf77e22a0a4cead66e0.tar.bz2
drm/printer: Add drm_vprintf()
Simple va_args equivalent to the existing drm_printf() for use with the drm_printer. v2: Fixup kerneldoc to match final parameter names. v3: Turn it into a kerneldoc comment Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Rob Clark <robdclark@gmail.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Dave Airlie <airlied@redhat.com> Acked-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20171123084051.30203-1-chris@chris-wilson.co.uk
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_print.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index 0968e411f562..5f9932e2246e 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -81,6 +81,21 @@ __printf(2, 3)
void drm_printf(struct drm_printer *p, const char *f, ...);
/**
+ * drm_vprintf - print to a &drm_printer stream
+ * @p: the &drm_printer
+ * @fmt: format string
+ * @va: the va_list
+ */
+__printf(2, 0)
+static inline void
+drm_vprintf(struct drm_printer *p, const char *fmt, va_list *va)
+{
+ struct va_format vaf = { .fmt = fmt, .va = va };
+
+ p->printfn(p, &vaf);
+}
+
+/**
* drm_printf_indent - Print to a &drm_printer stream with indentation
* @printer: DRM printer
* @indent: Tab indentation level (max 5)