On Tue, Jun 14, 2011 at 8:13 AM, Dave Airlie wrote:
> this puts the header and followup at the same loglevel as the
> hex dump code.
...
> bad:
> if (raw_edid) {
> - DRM_ERROR("Raw EDID:\n");
> + printk(KERN_ERR "Raw EDID:\n");
> print_hex_dump_bytes(KERN_ERR, DUMP_PREFIX_NONE, raw_edid,
> EDID_LENGTH);
> - printk("\n");
> + printk(KERN_ERR "\n");
> }
It won't work because print_hex_dump_bytes() always uses KERN_DEBUG
anyway. Its first argument is a string prefix so currently the value
of the KERN_ERR macro is printed out:
[drm:drm_edid_block_valid] *ERROR* Raw EDID:
<3>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
We can use print_hex_dump() instead, see attached patch. I even tested
it with "dmesg -r" - I think Linus prefers tested patches at this
point in the cycle :) But it is purely cosmetic and can wait for 3.1
also.
Maybe we eventually should print out in a format like xrandr and Xorg
do, so tools like edid-decode can eat it.
Cheers,
Tormod
From f64fd288c2d8555df82be884d48787138ee02c3b Mon Sep 17 00:00:00 2001
From: Tormod Volden <[email protected]>
Date: Fri, 17 Jun 2011 18:45:19 +0200
Subject: [PATCH] drm: really make debug levels match in edid failure code
Also disable the ascii dump and remove the literal printing of the
KERN_ERR macro in the log:
[drm:drm_edid_block_valid] *ERROR* Raw EDID:
<3>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
Signed-off-by: Tormod Volden <[email protected]>
---
drivers/gpu/drm/drm_edid.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 0929219..218f586 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -185,7 +185,8 @@ drm_edid_block_valid(u8 *raw_edid)
bad:
if (raw_edid) {
printk(KERN_ERR "Raw EDID:\n");
- print_hex_dump_bytes(KERN_ERR, DUMP_PREFIX_NONE, raw_edid, EDID_LENGTH);
+ print_hex_dump(KERN_ERR, " \t", DUMP_PREFIX_NONE, 16, 1,
+ raw_edid, EDID_LENGTH, false);
printk(KERN_ERR "\n");
}
return 0;
--
1.7.1
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel