public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Mika Kuoppala <mika.kuoppala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: jani.nikula@intel.com
Subject: Re: [PATCH] drm/i915: debug print all of the DPCD we have
Date: Thu, 25 Oct 2012 15:40:36 +0300	[thread overview]
Message-ID: <87wqyeohbv.fsf@gaia.fi.intel.com> (raw)
In-Reply-To: <1351151890-24891-1-git-send-email-jani.nikula@intel.com>

On Thu, 25 Oct 2012 10:58:10 +0300, Jani Nikula <jani.nikula@intel.com> 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 <jani.nikula@intel.com>
> 
> ---
> 
> 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 <mika.kuoppala@intel.com>

  reply	other threads:[~2012-10-25 12:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  7:58 [PATCH] drm/i915: debug print all of the DPCD we have Jani Nikula
2012-10-25 12:40 ` Mika Kuoppala [this message]
2012-10-25 13:00 ` Paulo Zanoni
2012-10-26 18:50   ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wqyeohbv.fsf@gaia.fi.intel.com \
    --to=mika.kuoppala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox