summaryrefslogtreecommitdiff
path: root/include/drm/drm_print.h
diff options
context:
space:
mode:
authorJordan Crouse <jcrouse@codeaurora.org>2018-07-24 19:33:21 +0300
committerRob Clark <robdclark@gmail.com>2018-07-30 15:49:35 +0300
commit63f4cc015b66dd265c2fd6e7c94be1b9a3b72267 (patch)
treecc66779ca5c9f64b0e35021e1d868d50052d6f5d /include/drm/drm_print.h
parentcfc57a18a3c5dc95d06db80bddd30015162c57d2 (diff)
downloadlinux-63f4cc015b66dd265c2fd6e7c94be1b9a3b72267.tar.xz
drm: Add drm_puts() to complement drm_printf()
Add drm_puts() for a much faster path to print constant strings into a drm_printer object with memcpy and friends. This can have seconds off of really large outputs such as GPU dumps. If the drm_printer object supports a custom puts function then use that otherwise fall back to the slower legacy printf call. v2: Add documentation for drm_puts() per Daniel Vetter Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> [robclark fix minor htmldocs warning] Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'include/drm/drm_print.h')
-rw-r--r--include/drm/drm_print.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/drm/drm_print.h b/include/drm/drm_print.h
index e7570f93a21f..f2f42bb87ef2 100644
--- a/include/drm/drm_print.h
+++ b/include/drm/drm_print.h
@@ -69,6 +69,7 @@
struct drm_printer {
/* private: */
void (*printfn)(struct drm_printer *p, struct va_format *vaf);
+ void (*puts)(struct drm_printer *p, const char *str);
void *arg;
const char *prefix;
};
@@ -80,6 +81,7 @@ 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, ...);
+void drm_puts(struct drm_printer *p, const char *str);
__printf(2, 0)
/**