From patchwork Fri Jun 17 19:38:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tormod Volden X-Patchwork-Id: 892272 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5HJcfS1002372 for ; Fri, 17 Jun 2011 19:39:02 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BBE40A0A85 for ; Fri, 17 Jun 2011 12:38:40 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-bw0-f49.google.com (mail-bw0-f49.google.com [209.85.214.49]) by gabe.freedesktop.org (Postfix) with ESMTP id CDAD09E8BC for ; Fri, 17 Jun 2011 12:38:31 -0700 (PDT) Received: by bwz1 with SMTP id 1so1816588bwz.36 for ; Fri, 17 Jun 2011 12:38:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=t0EvC941ZBRcFW6gqa8F+YAq6woTKUctptaXAKxI3XU=; b=HbTPDWkBps9aoem4r3WVTZbFqIap2DcM7RTFMSkNWqkGGQlN61wd9BnO5uA0PGjEa9 kwdAVNx8KDA9KVq+61lLsNTNOknZ1oNJKd1qcxNqSCEcdXGbAPqEri4/xFJy30AETqdn D2whtHfos+Be1K/xoIMHesNIvocyPJO6EKD6s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=OBfYimZU3C3+5sLvtXQbJX+c/IpXW/Tnv+q1w9l7kKAGM/+1H8XGXPfCA6Sb3Aav9k WR1B217K6MUlg/+yf1igMM6NwG8NHB0qcWE12B71gZo+Q2p+G8kBUUJdFDxwIav2cuyU +j1P9bQ7B5VAFPndWjslF0CG4ArYXnsvWjjTI= MIME-Version: 1.0 Received: by 10.204.42.68 with SMTP id r4mr903775bke.28.1308339510266; Fri, 17 Jun 2011 12:38:30 -0700 (PDT) Received: by 10.204.112.16 with HTTP; Fri, 17 Jun 2011 12:38:30 -0700 (PDT) In-Reply-To: <1308032036-23115-1-git-send-email-airlied@gmail.com> References: <1308032036-23115-1-git-send-email-airlied@gmail.com> Date: Fri, 17 Jun 2011 21:38:30 +0200 Message-ID: Subject: Re: [PATCH 1/3] drm: make debug levels match in edid failure code. From: Tormod Volden To: Dave Airlie Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 17 Jun 2011 19:39:02 +0000 (UTC) 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 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 --- 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