drm/amd/powerplay: add prefix for all powerplay pr_* prints

Powerplay will use them instead of raw printk, and we can dynamic
change the debug level with it.

The prefix is like below:

[  xxx.xxxxxx] amdgpu: [powerplay] ...

Suggested-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Cc: Arindam Nath <Arindam.Nath@amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Huang Rui 2016-12-23 10:45:07 +08:00 committed by Alex Deucher
parent 5c96422100
commit 7739b1e7e1
1 changed files with 8 additions and 2 deletions

View File

@ -24,6 +24,12 @@
#ifndef PP_DEBUG_H
#define PP_DEBUG_H
#ifdef pr_fmt
#undef pr_fmt
#endif
#define pr_fmt(fmt) "amdgpu: [powerplay] " fmt
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/slab.h>
@ -31,7 +37,7 @@
#define PP_ASSERT_WITH_CODE(cond, msg, code) \
do { \
if (!(cond)) { \
printk("%s\n", msg); \
pr_warning("%s\n", msg); \
code; \
} \
} while (0)
@ -39,7 +45,7 @@
#define PP_DBG_LOG(fmt, ...) \
do { \
if(0)printk(KERN_INFO "[ pp_dbg ] " fmt, ##__VA_ARGS__); \
pr_debug(fmt, ##__VA_ARGS__); \
} while (0)