public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 3/3] drm/i915/dp: move TPS3 logic to where it's used
Date: Thu, 27 Aug 2015 15:15:07 +0300	[thread overview]
Message-ID: <20150827121507.GA5176@intel.com> (raw)
In-Reply-To: <1440671138-17174-3-git-send-email-jani.nikula@intel.com>

On Thu, Aug 27, 2015 at 01:25:38PM +0300, Jani Nikula wrote:
> There is no need to have a separate flag for tps3 as the information is
> only used at one location. Move the logic there to make it easier to
> follow.
> 
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c  | 31 +++++++++++++++++--------------
>  drivers/gpu/drm/i915/intel_drv.h |  1 -
>  2 files changed, 17 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 50ba527763e9..12bce36065a1 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3848,13 +3848,25 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)
>  void
>  intel_dp_complete_link_train(struct intel_dp *intel_dp)
>  {
> +	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
> +	struct drm_device *dev = dig_port->base.base.dev;
>  	bool channel_eq = false;
>  	int tries, cr_tries;
>  	uint32_t DP = intel_dp->DP;
>  	uint32_t training_pattern = DP_TRAINING_PATTERN_2;
>  
> -	/* Training Pattern 3 for HBR2 or 1.2 devices that support it*/
> -	if (intel_dp->link_rate == 540000 || intel_dp->use_tps3)
> +	/*
> +	 * Training Pattern 3 for HBR2 or 1.2 devices that support it.
> +	 *
> +	 * Intel platforms that support HBR2 also support TPS3. TPS3 support is
> +	 * also mandatory for downstream devices that support HBR2.
> +	 *
> +	 * Due to WaDisableHBR2 SKL < B0 is the only exception where TPS3 is
> +	 * supported but still not enabled.
> +	 */
> +	if (intel_dp->link_rate == 540000 ||
> +	    (intel_dp_source_supports_hbr2(dev) &&
> +	     intel_dp_tps3_supported(intel_dp->dpcd)))

I'm thinking we could just kill the link_rate check here. It would
only make a difference if the sink lied in its DPCD.

>  		training_pattern = DP_TRAINING_PATTERN_3;
>  
>  	/* channel equalization */
> @@ -4036,18 +4048,9 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp)
>  		}
>  	}
>  
> -	/* Training Pattern 3 support, Intel platforms that support HBR2 alone
> -	 * have support for TP3 hence that check is used along with dpcd check
> -	 * to ensure TP3 can be enabled.
> -	 * SKL < B0: due it's WaDisableHBR2 is the only exception where TP3 is
> -	 * supported but still not enabled.
> -	 */
> -	if (intel_dp_tps3_supported(intel_dp->dpcd) &&
> -	    intel_dp_source_supports_hbr2(dev)) {
> -		intel_dp->use_tps3 = true;
> -		DRM_DEBUG_KMS("Displayport TPS3 supported\n");
> -	} else
> -		intel_dp->use_tps3 = false;
> +	DRM_DEBUG_KMS("Display Port TPS3 support: source %s, sink %s\n",
> +		      intel_dp_source_supports_hbr2(dev) ? "yes" : "no",
> +		      intel_dp_tps3_supported(intel_dp->dpcd) ? "yes" : "no");

I guess we don't have a one true yesno() macro. I think we have such
things in specific files. Maybe make it available everywhere?

But anyway, those are just food for thought, and the series looks good
so
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  
>  	/* Intermediate frequency support */
>  	if (is_edp(intel_dp) &&
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index c61ba47eda7c..fa9840fbccba 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -744,7 +744,6 @@ struct intel_dp {
>  	enum pipe pps_pipe;
>  	struct edp_power_seq pps_delays;
>  
> -	bool use_tps3;
>  	bool can_mst; /* this port supports mst */
>  	bool is_mst;
>  	int active_mst_links;
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-08-27 12:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-27 10:25 [PATCH v2 1/3] i915/dp: add intel_dp_tps3_supported helper Jani Nikula
2015-08-27 10:25 ` [PATCH v2 2/3] drm/i915/dp: use the drm dp helper for determining sink tps3 support Jani Nikula
2015-09-01  9:37   ` Daniel Vetter
2015-09-03  8:20     ` Jani Nikula
2015-08-27 10:25 ` [PATCH v2 3/3] drm/i915/dp: move TPS3 logic to where it's used Jani Nikula
2015-08-27 12:15   ` Ville Syrjälä [this message]
2015-08-27 13:23     ` [PATCH 0/3] follow-up Jani Nikula
2015-08-27 13:23       ` [PATCH 1/3] drm/i915: ignore link rate in TPS3 selection Jani Nikula
2015-08-27 13:23       ` [PATCH 2/3] drm/i915: add yesno utility function Jani Nikula
2015-08-27 13:28         ` Chris Wilson
2015-08-27 13:53           ` Jani Nikula
2015-08-31 14:23             ` Jani Nikula
2015-08-31 14:33               ` Chris Wilson
2015-09-02  9:17                 ` Daniel Vetter
2015-08-27 13:23       ` [PATCH 3/3] drm/i915: use the yesno helper for logging Jani Nikula
2015-08-29 19:00   ` [PATCH v2 3/3] drm/i915/dp: move TPS3 logic to where it's used shuang.he

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=20150827121507.GA5176@intel.com \
    --to=ville.syrjala@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