diff options
author | yakui_zhao <yakui.zhao@intel.com> | 2009-06-02 02:09:47 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-06-11 04:36:36 -0400 |
commit | 4fefcb27050b98c97b1c32bc710fc2f874449dee (patch) | |
tree | 1983f5ca546dab13d56ad8207762fee6088c9079 /drivers | |
parent | df4f7fe7bd516b3833e25c692c3970e22038a6ca (diff) |
drm: add separate drm debugging levels
Now all the DRM debug info will be reported if the boot option of
"drm.debug=1" is added. Sometimes it is inconvenient to get the debug
info in KMS mode. We will get too much unrelated info.
This will separate several DRM debug levels and the debug level can be used
to print the different debug info. And the debug level is controlled by the
module parameter of drm.debug
In this patch it is divided into four debug levels;
drm_core, drm_driver, drm_kms, drm_mode.
At the same time we can get the different debug info by changing the debug
level. This can be done by adding the module parameter. Of course it can
be changed through the /sys/module/drm/parameters/debug after the system is
booted.
Four debug macro definitions are provided.
DRM_DEBUG(fmt, args...)
DRM_DEBUG_DRIVER(prefix, fmt, args...)
DRM_DEBUG_KMS(prefix, fmt, args...)
DRM_DEBUG_MODE(prefix, fmt, args...)
When the boot option of "drm.debug=4" is added, it will print the debug info
using DRM_DEBUG_KMS macro definition.
When the boot option of "drm.debug=6" is added, it will print the debug info
using DRM_DEBUG_KMS/DRM_DEBUG_DRIVER.
Sometimes we expect to print the value of an array.
For example: SDVO command,
In such case the following four DRM debug macro definitions are added:
DRM_LOG(fmt, args...)
DRM_LOG_DRIVER(fmt, args...)
DRM_LOG_KMS(fmt, args...)
DRM_LOG_MODE(fmt, args...)
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/drm_stub.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index b9631e3a1ea6..89050684fe0d 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c | |||
@@ -51,7 +51,22 @@ struct idr drm_minors_idr; | |||
51 | struct class *drm_class; | 51 | struct class *drm_class; |
52 | struct proc_dir_entry *drm_proc_root; | 52 | struct proc_dir_entry *drm_proc_root; |
53 | struct dentry *drm_debugfs_root; | 53 | struct dentry *drm_debugfs_root; |
54 | 54 | void drm_ut_debug_printk(unsigned int request_level, | |
55 | const char *prefix, | ||
56 | const char *function_name, | ||
57 | const char *format, ...) | ||
58 | { | ||
59 | va_list args; | ||
60 | |||
61 | if (drm_debug & request_level) { | ||
62 | if (function_name) | ||
63 | printk(KERN_DEBUG "[%s:%s], ", prefix, function_name); | ||
64 | va_start(args, format); | ||
65 | vprintk(format, args); | ||
66 | va_end(args); | ||
67 | } | ||
68 | } | ||
69 | EXPORT_SYMBOL(drm_ut_debug_printk); | ||
55 | static int drm_minor_get_id(struct drm_device *dev, int type) | 70 | static int drm_minor_get_id(struct drm_device *dev, int type) |
56 | { | 71 | { |
57 | int new_id; | 72 | int new_id; |