drm: Move debug macros out of drmP.h
This patch extract DRM_* debug macros from drmP.h to drm_print.h and move printing related functions used by these macros from drm_drv.[hc] to drm_print.[hc]. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: https://patchwork.freedesktop.org/patch/msgid/4020bc7c5ffad2af516919f78bb837c7f366b82b.1508297716.git.hamohammed.sa@gmail.com
This commit is contained in:

committed by
Sean Paul

parent
102712a32f
commit
02c9656b2f
@@ -74,53 +74,6 @@ static bool drm_core_init_complete = false;
|
||||
|
||||
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, ...)
|
||||
{
|
||||
struct va_format vaf;
|
||||
va_list args;
|
||||
|
||||
if (category != DRM_UT_NONE && !(drm_debug & category))
|
||||
return;
|
||||
|
||||
va_start(args, format);
|
||||
vaf.fmt = format;
|
||||
vaf.va = &args;
|
||||
|
||||
if (dev)
|
||||
dev_printk(level, dev, DRM_PRINTK_FMT, function_name, prefix,
|
||||
&vaf);
|
||||
else
|
||||
printk("%s" DRM_PRINTK_FMT, level, function_name, prefix, &vaf);
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
EXPORT_SYMBOL(drm_dev_printk);
|
||||
|
||||
void drm_printk(const char *level, unsigned int category,
|
||||
const char *format, ...)
|
||||
{
|
||||
struct va_format vaf;
|
||||
va_list args;
|
||||
|
||||
if (category != DRM_UT_NONE && !(drm_debug & category))
|
||||
return;
|
||||
|
||||
va_start(args, format);
|
||||
vaf.fmt = format;
|
||||
vaf.va = &args;
|
||||
|
||||
printk("%s" "[" DRM_NAME ":%ps]%s %pV",
|
||||
level, __builtin_return_address(0),
|
||||
strcmp(level, KERN_ERR) == 0 ? " *ERROR*" : "", &vaf);
|
||||
|
||||
va_end(args);
|
||||
}
|
||||
EXPORT_SYMBOL(drm_printk);
|
||||
|
||||
/*
|
||||
* DRM Minors
|
||||
* A DRM device can provide several char-dev interfaces on the DRM-Major. Each
|
||||
|
Reference in New Issue
Block a user