summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_print.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 21:00:37 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-19 21:00:37 +0000
commit94ac2ab3fff96814d7460a27a0e9d004abbd4128 (patch)
tree9a4eb8cc234b540b0f4b93363109cdd37a20540b /drivers/gpu/drm/drm_print.c
parentAdding debian version 6.8.12-1. (diff)
downloadlinux-94ac2ab3fff96814d7460a27a0e9d004abbd4128.tar.xz
linux-94ac2ab3fff96814d7460a27a0e9d004abbd4128.zip
Merging upstream version 6.9.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'drivers/gpu/drm/drm_print.c')
-rw-r--r--drivers/gpu/drm/drm_print.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_print.c b/drivers/gpu/drm/drm_print.c
index 5b93c11895..699b7dbffd 100644
--- a/drivers/gpu/drm/drm_print.c
+++ b/drivers/gpu/drm/drm_print.c
@@ -182,16 +182,35 @@ void __drm_printfn_info(struct drm_printer *p, struct va_format *vaf)
}
EXPORT_SYMBOL(__drm_printfn_info);
-void __drm_printfn_debug(struct drm_printer *p, struct va_format *vaf)
+void __drm_printfn_dbg(struct drm_printer *p, struct va_format *vaf)
{
- /* pr_debug callsite decorations are unhelpful here */
- printk(KERN_DEBUG "%s %pV", p->prefix, vaf);
+ const struct drm_device *drm = p->arg;
+ const struct device *dev = drm ? drm->dev : NULL;
+ enum drm_debug_category category = p->category;
+ const char *prefix = p->prefix ?: "";
+ const char *prefix_pad = p->prefix ? " " : "";
+
+ if (!__drm_debug_enabled(category))
+ return;
+
+ /* Note: __builtin_return_address(0) is useless here. */
+ if (dev)
+ dev_printk(KERN_DEBUG, dev, "[" DRM_NAME "]%s%s %pV",
+ prefix_pad, prefix, vaf);
+ else
+ printk(KERN_DEBUG "[" DRM_NAME "]%s%s %pV",
+ prefix_pad, prefix, vaf);
}
-EXPORT_SYMBOL(__drm_printfn_debug);
+EXPORT_SYMBOL(__drm_printfn_dbg);
void __drm_printfn_err(struct drm_printer *p, struct va_format *vaf)
{
- pr_err("*ERROR* %s %pV", p->prefix, vaf);
+ struct drm_device *drm = p->arg;
+
+ if (p->prefix)
+ drm_err(drm, "%s %pV", p->prefix, vaf);
+ else
+ drm_err(drm, "%pV", vaf);
}
EXPORT_SYMBOL(__drm_printfn_err);