Commit c2ef66e9 authored by Michal Wajdeczko's avatar Michal Wajdeczko Committed by Rodrigo Vivi

drm/print: Improve drm_dbg_printer

With recent introduction of a generic drm dev printk function, we
can now store and use location where drm_dbg_printer was invoked
and output it's symbolic name like we do for all drm debug prints.

Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarMichal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240517163406.2348-3-michal.wajdeczko@intel.comSigned-off-by: default avatarRodrigo Vivi <rodrigo.vivi@intel.com>
parent 178c0a33
...@@ -217,8 +217,7 @@ void __drm_printfn_dbg(struct drm_printer *p, struct va_format *vaf) ...@@ -217,8 +217,7 @@ void __drm_printfn_dbg(struct drm_printer *p, struct va_format *vaf)
if (!__drm_debug_enabled(category)) if (!__drm_debug_enabled(category))
return; return;
/* Note: __builtin_return_address(0) is useless here. */ __drm_dev_vprintk(dev, KERN_DEBUG, p->origin, p->prefix, vaf);
__drm_dev_vprintk(dev, KERN_DEBUG, NULL, p->prefix, vaf);
} }
EXPORT_SYMBOL(__drm_printfn_dbg); EXPORT_SYMBOL(__drm_printfn_dbg);
......
...@@ -175,6 +175,7 @@ struct drm_printer { ...@@ -175,6 +175,7 @@ struct drm_printer {
void (*printfn)(struct drm_printer *p, struct va_format *vaf); void (*printfn)(struct drm_printer *p, struct va_format *vaf);
void (*puts)(struct drm_printer *p, const char *str); void (*puts)(struct drm_printer *p, const char *str);
void *arg; void *arg;
const void *origin;
const char *prefix; const char *prefix;
enum drm_debug_category category; enum drm_debug_category category;
}; };
...@@ -332,6 +333,7 @@ static inline struct drm_printer drm_dbg_printer(struct drm_device *drm, ...@@ -332,6 +333,7 @@ static inline struct drm_printer drm_dbg_printer(struct drm_device *drm,
struct drm_printer p = { struct drm_printer p = {
.printfn = __drm_printfn_dbg, .printfn = __drm_printfn_dbg,
.arg = drm, .arg = drm,
.origin = (const void *)_THIS_IP_, /* it's fine as we will be inlined */
.prefix = prefix, .prefix = prefix,
.category = category, .category = category,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment