@@ -65,11 +65,10 @@ static struct idr drm_minors_idr;
static struct dentry *drm_debugfs_root;
-#define DRM_PRINTK_FMT "[" DRM_NAME ":%s]%s %pV"
-
void drm_dev_printk(const struct device *dev, const char *level,
- unsigned int category, const char *function_name,
- const char *prefix, const char *format, ...)
+ unsigned int category, const char *driver,
+ const char *function_name, const char *prefix,
+ const char *format, ...)
{
struct va_format vaf;
va_list args;
@@ -82,10 +81,11 @@ void drm_dev_printk(const struct device *dev, const char *level,
vaf.va = &args;
if (dev)
- dev_printk(level, dev, DRM_PRINTK_FMT, function_name, prefix,
- &vaf);
+ dev_printk(level, dev, "[%s:%ps]%s %pV",
+ driver, function_name, prefix, &vaf);
else
- printk("%s" DRM_PRINTK_FMT, level, function_name, prefix, &vaf);
+ printk("%s[%s:%ps]%s %pV",
+ level, driver, function_name, prefix, &vaf);
va_end(args);
}
@@ -101,7 +101,8 @@ i915_load_error(struct drm_i915_private *dev_priv, const char *fmt, ...)
vaf.fmt = fmt;
vaf.va = &args;
- drm_dev_printk(kdev, level, DRM_UT_DRIVER, __func__, "", fmt, &vaf);
+ drm_dev_printk(kdev, level, DRM_UT_DRIVER, DRM_NAME, __func__, "",
+ fmt, &vaf);
va_end(args);
@@ -173,8 +173,8 @@ struct dma_buf_attachment;
* \param arg arguments
*/
#define DRM_DEV_ERROR(dev, fmt, ...) \
- drm_dev_printk(dev, KERN_ERR, DRM_UT_NONE, __func__, " *ERROR*",\
- fmt, ##__VA_ARGS__)
+ drm_dev_printk(dev, KERN_ERR, DRM_UT_NONE, DRM_NAME, __func__, \
+ " *ERROR*", fmt, ##__VA_ARGS__)
#define DRM_ERROR(fmt, ...) \
drm_printk(KERN_ERR, DRM_UT_NONE, DRM_NAME, fmt, ##__VA_ARGS__)
@@ -197,8 +197,8 @@ struct dma_buf_attachment;
DRM_DEV_ERROR_RATELIMITED(NULL, fmt, ##__VA_ARGS__)
#define DRM_DEV_INFO(dev, fmt, ...) \
- drm_dev_printk(dev, KERN_INFO, DRM_UT_NONE, __func__, "", fmt, \
- ##__VA_ARGS__)
+ drm_dev_printk(dev, KERN_INFO, DRM_UT_NONE, DRM_NAME, __func__, \
+ "", fmt, ##__VA_ARGS__)
#define DRM_DEV_INFO_ONCE(dev, fmt, ...) \
({ \
@@ -216,38 +216,38 @@ struct dma_buf_attachment;
* \param arg arguments
*/
#define DRM_DEV_DEBUG(dev, fmt, args...) \
- drm_dev_printk(dev, KERN_DEBUG, DRM_UT_CORE, __func__, "", fmt, \
- ##args)
+ drm_dev_printk(dev, KERN_DEBUG, DRM_UT_CORE, DRM_NAME, __func__,\
+ "", fmt, ##args)
#define DRM_DEBUG(fmt, ...) \
drm_printk(KERN_DEBUG, DRM_UT_CORE, DRM_NAME, fmt, ##__VA_ARGS__)
#define DRM_DEV_DEBUG_DRIVER(dev, fmt, args...) \
- drm_dev_printk(dev, KERN_DEBUG, DRM_UT_DRIVER, __func__, "", \
- fmt, ##args)
+ drm_dev_printk(dev, KERN_DEBUG, DRM_UT_DRIVER, DRM_NAME, \
+ __func__, "", fmt, ##args)
#define DRM_DEBUG_DRIVER(fmt, ...) \
drm_printk(KERN_DEBUG, DRM_UT_DRIVER, DRM_NAME, fmt, ##__VA_ARGS__)
#define DRM_DEV_DEBUG_KMS(dev, fmt, args...) \
- drm_dev_printk(dev, KERN_DEBUG, DRM_UT_KMS, __func__, "", fmt, \
- ##args)
-#define DRM_DEBUG_KMS(fmt, ...) \
+ drm_dev_printk(dev, KERN_DEBUG, DRM_UT_KMS, DRM_NAME, __func__, \
+ "", fmt, ##args)
+#define DRM_DEBUG_KMS(fmt, ...) \
drm_printk(KERN_DEBUG, DRM_UT_KMS, DRM_NAME, fmt, ##__VA_ARGS__)
#define DRM_DEV_DEBUG_PRIME(dev, fmt, args...) \
- drm_dev_printk(dev, KERN_DEBUG, DRM_UT_PRIME, __func__, "", \
- fmt, ##args)
+ drm_dev_printk(dev, KERN_DEBUG, DRM_UT_PRIME, DRM_NAME, \
+ __func__, "", fmt, ##args)
#define DRM_DEBUG_PRIME(fmt, ...) \
drm_printk(KERN_DEBUG, DRM_UT_PRIME, DRM_NAME, fmt, ##__VA_ARGS__)
#define DRM_DEV_DEBUG_ATOMIC(dev, fmt, args...) \
- drm_dev_printk(dev, KERN_DEBUG, DRM_UT_ATOMIC, __func__, "", \
- fmt, ##args)
+ drm_dev_printk(dev, KERN_DEBUG, DRM_UT_ATOMIC, DRM_NAME, \
+ __func__, "", fmt, ##args)
#define DRM_DEBUG_ATOMIC(fmt, ...) \
drm_printk(KERN_DEBUG, DRM_UT_ATOMIC, DRM_NAME, fmt, ##__VA_ARGS__)
#define DRM_DEV_DEBUG_VBL(dev, fmt, args...) \
- drm_dev_printk(dev, KERN_DEBUG, DRM_UT_VBL, __func__, "", fmt, \
- ##args)
+ drm_dev_printk(dev, KERN_DEBUG, DRM_UT_VBL, DRM_NAME, __func__, \
+ "", fmt, ##args)
#define DRM_DEBUG_VBL(fmt, ...) \
drm_printk(KERN_DEBUG, DRM_UT_VBL, DRM_NAME, fmt, ##__VA_ARGS__)
@@ -258,7 +258,7 @@ struct dma_buf_attachment;
DEFAULT_RATELIMIT_BURST); \
if (__ratelimit(&_rs)) \
drm_dev_printk(dev, KERN_DEBUG, DRM_UT_ ## level, \
- __func__, "", fmt, ##args); \
+ DRM_NAME, __func__, "", fmt, ##args); \
})
/**
@@ -407,10 +407,11 @@ struct drm_driver {
struct list_head legacy_dev_list;
};
-extern __printf(6, 7)
+extern __printf(7, 8)
void drm_dev_printk(const struct device *dev, const char *level,
- unsigned int category, const char *function_name,
- const char *prefix, const char *format, ...);
+ unsigned int category, const char *driver,
+ const char *function_name, const char *prefix,
+ const char *format, ...);
extern __printf(4, 5)
void drm_printk(const char *level, unsigned int category,
const char *driver, const char *format, ...);