From: Mika Kuoppala Subject: Re: [PATCH] drm/i915: debug print all of the DPCD we have Date: Thu, 25 Oct 2012 15:40:36 +0300 Message-ID: <87wqyeohbv.fsf@gaia.fi.intel.com> References: <1351151890-24891-1-git-send-email-jani.nikula@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 49C1A9E8DD for ; Thu, 25 Oct 2012 05:40:39 -0700 (PDT) In-Reply-To: <1351151890-24891-1-git-send-email-jani.nikula@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org Cc: jani.nikula@intel.com List-Id: intel-gfx@lists.freedesktop.org On Thu, 25 Oct 2012 10:58:10 +0300, Jani Nikula wrote: > At some point the DPCD size was increased, but the debug print not. While > at it, switch to using hex dump. > > Signed-off-by: Jani Nikula > > --- > > The obvious downside here is that the hex dumping to buffer is done > regardless of drm.debug value. I thought it was still better than the > alternatives: > > 1) DRM_DEBUG_KMS with loads of %02x as it were > > 2) if (drm_debug & DRM_UT_KMS) > > 3) print_hex_dump(KERN_DEBUG, ... ) > > 4) adding a new drm_print_hex_dump or similar that does 2) internally > --- > drivers/gpu/drm/i915/intel_dp.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c > index 01b67d9..52eea34 100644 > --- a/drivers/gpu/drm/i915/intel_dp.c > +++ b/drivers/gpu/drm/i915/intel_dp.c > @@ -2278,6 +2278,7 @@ intel_dp_detect(struct drm_connector *connector, bool force) > struct drm_device *dev = intel_dp->base.base.dev; > enum drm_connector_status status; > struct edid *edid = NULL; > + char dpcd_hex_dump[sizeof(intel_dp->dpcd) * 3]; It seems hex_dump_to_buffer nukes trailing ' ' before inserting null. Would make reader less nervous by adding + 1 thought, for courtesy :) > intel_dp->has_audio = false; > > @@ -2286,10 +2287,9 @@ intel_dp_detect(struct drm_connector *connector, bool force) > else > status = g4x_dp_detect(intel_dp); > > - DRM_DEBUG_KMS("DPCD: %02hx%02hx%02hx%02hx%02hx%02hx%02hx%02hx\n", > - intel_dp->dpcd[0], intel_dp->dpcd[1], intel_dp->dpcd[2], > - intel_dp->dpcd[3], intel_dp->dpcd[4], intel_dp->dpcd[5], > - intel_dp->dpcd[6], intel_dp->dpcd[7]); > + hex_dump_to_buffer(intel_dp->dpcd, sizeof(intel_dp->dpcd), > + 32, 1, dpcd_hex_dump, sizeof(dpcd_hex_dump), false); > + DRM_DEBUG_KMS("DPCD: %s\n", dpcd_hex_dump); > > if (status != connector_status_connected) > return status; > -- > 1.7.9.5 Reviewed-by: Mika Kuoppala