All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	dhinakaran.pandiyan@intel.com
Subject: Re: [PATCH 2/4] drm/i915: use drm DP helper to read DPCD desc
Date: Thu, 18 May 2017 08:03:25 +0200	[thread overview]
Message-ID: <20170518060325.bsbsysagdaqbxdkb@phenom.ffwll.local> (raw)
In-Reply-To: <b2cef85c9d14c95e1d5e164823de74375485ae79.1495030890.git.jani.nikula@intel.com>

On Wed, May 17, 2017 at 05:25:14PM +0300, Jani Nikula wrote:
> Switch to using the common DP helpers instead of using our own.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Forgot to remove struct intel_dp_desc, otherwise lgtm.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> ---
>  drivers/gpu/drm/i915/intel_dp.c     | 37 ++++---------------------------------
>  drivers/gpu/drm/i915/intel_drv.h    |  5 +----
>  drivers/gpu/drm/i915/intel_lspcon.c |  2 +-
>  3 files changed, 6 insertions(+), 38 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 4a6feb6a69bd..2a5f385e8f44 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -1548,37 +1548,6 @@ static void intel_dp_print_rates(struct intel_dp *intel_dp)
>  	DRM_DEBUG_KMS("common rates: %s\n", str);
>  }
>  
> -bool
> -__intel_dp_read_desc(struct intel_dp *intel_dp, struct intel_dp_desc *desc)
> -{
> -	u32 base = drm_dp_is_branch(intel_dp->dpcd) ? DP_BRANCH_OUI :
> -						      DP_SINK_OUI;
> -
> -	return drm_dp_dpcd_read(&intel_dp->aux, base, desc, sizeof(*desc)) ==
> -	       sizeof(*desc);
> -}
> -
> -bool intel_dp_read_desc(struct intel_dp *intel_dp)
> -{
> -	struct intel_dp_desc *desc = &intel_dp->desc;
> -	bool oui_sup = intel_dp->dpcd[DP_DOWN_STREAM_PORT_COUNT] &
> -		       DP_OUI_SUPPORT;
> -	int dev_id_len;
> -
> -	if (!__intel_dp_read_desc(intel_dp, desc))
> -		return false;
> -
> -	dev_id_len = strnlen(desc->device_id, sizeof(desc->device_id));
> -	DRM_DEBUG_KMS("DP %s: OUI %*phD%s dev-ID %*pE HW-rev %d.%d SW-rev %d.%d\n",
> -		      drm_dp_is_branch(intel_dp->dpcd) ? "branch" : "sink",
> -		      (int)sizeof(desc->oui), desc->oui, oui_sup ? "" : "(NS)",
> -		      dev_id_len, desc->device_id,
> -		      desc->hw_rev >> 4, desc->hw_rev & 0xf,
> -		      desc->sw_major_rev, desc->sw_minor_rev);
> -
> -	return true;
> -}
> -
>  int
>  intel_dp_max_link_rate(struct intel_dp *intel_dp)
>  {
> @@ -3662,7 +3631,8 @@ intel_edp_init_dpcd(struct intel_dp *intel_dp)
>  	if (!intel_dp_read_dpcd(intel_dp))
>  		return false;
>  
> -	intel_dp_read_desc(intel_dp);
> +	drm_dp_read_desc(&intel_dp->aux, &intel_dp->desc,
> +			 drm_dp_is_branch(intel_dp->dpcd));
>  
>  	if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11)
>  		dev_priv->no_aux_handshake = intel_dp->dpcd[DP_MAX_DOWNSPREAD] &
> @@ -4677,7 +4647,8 @@ intel_dp_long_pulse(struct intel_connector *intel_connector)
>  
>  	intel_dp_print_rates(intel_dp);
>  
> -	intel_dp_read_desc(intel_dp);
> +	drm_dp_read_desc(&intel_dp->aux, &intel_dp->desc,
> +			 drm_dp_is_branch(intel_dp->dpcd));
>  
>  	intel_dp_configure_mst(intel_dp);
>  
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index bd500977b3fc..61a9981343d5 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -996,7 +996,7 @@ struct intel_dp {
>  	/* Max rate for the current link */
>  	int max_link_rate;
>  	/* sink or branch descriptor */
> -	struct intel_dp_desc desc;
> +	struct drm_dp_desc desc;
>  	struct drm_dp_aux aux;
>  	enum intel_display_power_domain aux_power_domain;
>  	uint8_t train_set[4];
> @@ -1571,9 +1571,6 @@ static inline unsigned int intel_dp_unused_lane_mask(int lane_count)
>  }
>  
>  bool intel_dp_read_dpcd(struct intel_dp *intel_dp);
> -bool __intel_dp_read_desc(struct intel_dp *intel_dp,
> -			  struct intel_dp_desc *desc);
> -bool intel_dp_read_desc(struct intel_dp *intel_dp);
>  int intel_dp_link_required(int pixel_clock, int bpp);
>  int intel_dp_max_data_rate(int max_link_clock, int max_lanes);
>  bool intel_digital_port_connected(struct drm_i915_private *dev_priv,
> diff --git a/drivers/gpu/drm/i915/intel_lspcon.c b/drivers/gpu/drm/i915/intel_lspcon.c
> index 71cbe9c08932..5abef482eacf 100644
> --- a/drivers/gpu/drm/i915/intel_lspcon.c
> +++ b/drivers/gpu/drm/i915/intel_lspcon.c
> @@ -240,7 +240,7 @@ bool lspcon_init(struct intel_digital_port *intel_dig_port)
>  		return false;
>  	}
>  
> -	intel_dp_read_desc(dp);
> +	drm_dp_read_desc(&dp->aux, &dp->desc, drm_dp_is_branch(dp->dpcd));
>  
>  	DRM_DEBUG_KMS("Success: LSPCON init\n");
>  	return true;
> -- 
> 2.11.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-05-18  6:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 14:25 [PATCH 0/4] drm/dp: device identification and quirks Jani Nikula
2017-05-17 14:25 ` [PATCH 1/4] drm/dp: add helper for reading DP sink/branch device desc from DPCD Jani Nikula
2017-05-17 14:25 ` [PATCH 2/4] drm/i915: use drm DP helper to read DPCD desc Jani Nikula
2017-05-18  6:03   ` Daniel Vetter [this message]
2017-05-17 14:25 ` [PATCH 3/4] drm/dp: start a DPCD based DP sink/branch device quirk database Jani Nikula
2017-05-17 21:40   ` Clint Taylor
2017-05-18 10:32     ` Jani Nikula
2017-05-17 14:25 ` [PATCH 4/4] drm/i915: Detect USB-C specific dongles before reducing M and N Jani Nikula
2017-05-18  6:09   ` Daniel Vetter
2017-05-17 15:10 ` ✓ Fi.CI.BAT: success for drm/dp: device identification and quirks Patchwork
2017-05-18 11:10 [PATCH 0/4] drm/dp: device identification and quirks ~v3 Jani Nikula
2017-05-18 11:10 ` [PATCH 2/4] drm/i915: use drm DP helper to read DPCD desc Jani Nikula

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=20170518060325.bsbsysagdaqbxdkb@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dhinakaran.pandiyan@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.