Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Adam Jackson <ajax@redhat.com>, intel-gfx@lists.freedesktop.org
Cc: tiwai@suse.de
Subject: Re: [PATCH 3/4] drm/i915/dp: Fetch downstream port info if needed during DPCD fetch
Date: Tue, 18 Sep 2012 12:02:24 +0300	[thread overview]
Message-ID: <87392f900v.fsf@intel.com> (raw)
In-Reply-To: <1347902730-8197-4-git-send-email-ajax@redhat.com>

On Mon, 17 Sep 2012, Adam Jackson <ajax@redhat.com> wrote:
> Signed-off-by: Adam Jackson <ajax@redhat.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c |   25 ++++++++++++++++++++-----
>  1 files changed, 20 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index ace757a..92939bd 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -39,6 +39,7 @@
>  #include "drm_dp_helper.h"
>  
>  #define DP_RECEIVER_CAP_SIZE	0xf
> +#define DP_MAX_DOWNSTREAM_PORTS 0xf
>  #define DP_LINK_STATUS_SIZE	6
>  #define DP_LINK_CHECK_TIMEOUT	(10 * 1000)
>  
> @@ -56,6 +57,7 @@ struct intel_dp {
>  	uint8_t link_bw;
>  	uint8_t lane_count;
>  	uint8_t dpcd[DP_RECEIVER_CAP_SIZE];
> +	uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS];
>  	struct i2c_adapter adapter;
>  	struct i2c_algo_dp_aux_data algo;
>  	bool is_pch_edp;
> @@ -1968,12 +1970,25 @@ static bool
>  intel_dp_get_dpcd(struct intel_dp *intel_dp)
>  {
>  	if (intel_dp_aux_native_read_retry(intel_dp, 0x000, intel_dp->dpcd,
> -					   sizeof(intel_dp->dpcd)) &&
> -	    (intel_dp->dpcd[DP_DPCD_REV] != 0)) {
> -		return true;
> -	}
> +					   sizeof(intel_dp->dpcd) == 0))

Misplaced brace, isn't it? You're passing "sizeof(intel_dp->dpcd) == 0"
as length.

BR,
Jani.

> +		return false; /* aux transfer failed */
>  
> -	return false;
> +	if (intel_dp->dpcd[DP_DPCD_REV] == 0)
> +		return false; /* DPCD not present */
> +
> +	if (!(intel_dp->dpcd[DP_DOWNSTREAMPORT_PRESENT] &
> +	      DP_DWN_STRM_PORT_PRESENT))
> +		return true; /* native DP sink */
> +
> +	if (intel_dp->dpcd[DP_DPCD_REV] == 0x10)
> +		return true; /* no per-port downstream info */
> +
> +	if (intel_dp_aux_native_read_retry(intel_dp, DP_DOWNSTREAM_PORT_0,
> +					   intel_dp->downstream_ports,
> +					   DP_MAX_DOWNSTREAM_PORTS) == 0)
> +		return false; /* downstream port status fetch failed */
> +
> +	return true;
>  }
>  
>  static void
> -- 
> 1.7.7.6
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2012-09-18  8:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17 17:25 [PATCH 0/4] Fix handling of DP bridge devices Adam Jackson
2012-09-17 17:25 ` [PATCH 1/4] drm: Export drm_probe_ddc() Adam Jackson
2012-09-17 17:25 ` [PATCH 2/4] drm/dp: Update DPCD defines Adam Jackson
2012-09-17 17:25 ` [PATCH 3/4] drm/i915/dp: Fetch downstream port info if needed during DPCD fetch Adam Jackson
2012-09-18  9:02   ` Jani Nikula [this message]
2012-09-17 17:25 ` [PATCH 4/4] drm/i915/dp: Be smarter about connection sense for branch devices Adam Jackson
  -- strict thread matches above, loose matches on Subject: below --
2012-09-18 14:58 [PATCH 1/4] drm: Export drm_probe_ddc() Adam Jackson
2012-09-18 14:58 ` [PATCH 3/4] drm/i915/dp: Fetch downstream port info if needed during DPCD fetch Adam Jackson
2012-09-20 12:28   ` [Intel-gfx] " Jani Nikula
2012-09-26 12:23     ` 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=87392f900v.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=ajax@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=tiwai@suse.de \
    /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