All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Weinehall <david.weinehall@linux.intel.com>
To: ville.syrjala@linux.intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/9] drm/i915: Program iboost settings for HDMI/DVI on SKL
Date: Wed, 13 Jul 2016 18:30:30 +0300	[thread overview]
Message-ID: <20160713153030.GB3839@boom> (raw)
In-Reply-To: <1468328376-6380-4-git-send-email-ville.syrjala@linux.intel.com>

On Tue, Jul 12, 2016 at 03:59:30PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Currently we fail to program the iboost stuff for HDMI/DVI. Let's remedy
> that.
> 
> Cc: David Weinehall <david.weinehall@linux.intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: David Weinehall <david.weinehall@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 51 +++++++++++++++++++++++++++++++---------
>  1 file changed, 40 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 78e1fdaec86d..09fe580dfd49 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -388,6 +388,40 @@ skl_get_buf_trans_hdmi(struct drm_i915_private *dev_priv, int *n_entries)
>  	}
>  }
>  
> +static int intel_ddi_hdmi_level(struct drm_i915_private *dev_priv, enum port port)
> +{
> +	int n_hdmi_entries;
> +	int hdmi_level;
> +	int hdmi_default_entry;
> +
> +	hdmi_level = dev_priv->vbt.ddi_port_info[port].hdmi_level_shift;
> +
> +	if (IS_BROXTON(dev_priv))
> +		return hdmi_level;
> +
> +	if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv)) {
> +		skl_get_buf_trans_hdmi(dev_priv, &n_hdmi_entries);
> +		hdmi_default_entry = 8;
> +	} else if (IS_BROADWELL(dev_priv)) {
> +		n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
> +		hdmi_default_entry = 7;
> +	} else if (IS_HASWELL(dev_priv)) {
> +		n_hdmi_entries = ARRAY_SIZE(hsw_ddi_translations_hdmi);
> +		hdmi_default_entry = 6;
> +	} else {
> +		WARN(1, "ddi translation table missing\n");
> +		n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
> +		hdmi_default_entry = 7;
> +	}
> +
> +	/* Choose a good default if VBT is badly populated */
> +	if (hdmi_level == HDMI_LEVEL_SHIFT_UNKNOWN ||
> +	    hdmi_level >= n_hdmi_entries)
> +		hdmi_level = hdmi_default_entry;
> +
> +	return hdmi_level;
> +}
> +
>  /*
>   * Starting with Haswell, DDI port buffers must be programmed with correct
>   * values in advance. The buffer values are different for FDI and DP modes,
> @@ -399,7 +433,7 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
>  	u32 iboost_bit = 0;
> -	int i, n_hdmi_entries, n_dp_entries, n_edp_entries, hdmi_default_entry,
> +	int i, n_hdmi_entries, n_dp_entries, n_edp_entries,
>  	    size;
>  	int hdmi_level;
>  	enum port port;
> @@ -410,7 +444,7 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
>  	const struct ddi_buf_trans *ddi_translations;
>  
>  	port = intel_ddi_get_encoder_port(encoder);
> -	hdmi_level = dev_priv->vbt.ddi_port_info[port].hdmi_level_shift;
> +	hdmi_level = intel_ddi_hdmi_level(dev_priv, port);
>  
>  	if (IS_BROXTON(dev_priv)) {
>  		if (encoder->type != INTEL_OUTPUT_HDMI)
> @@ -430,7 +464,6 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
>  				skl_get_buf_trans_edp(dev_priv, &n_edp_entries);
>  		ddi_translations_hdmi =
>  				skl_get_buf_trans_hdmi(dev_priv, &n_hdmi_entries);
> -		hdmi_default_entry = 8;
>  		/* If we're boosting the current, set bit 31 of trans1 */
>  		if (dev_priv->vbt.ddi_port_info[port].hdmi_boost_level ||
>  		    dev_priv->vbt.ddi_port_info[port].dp_boost_level)
> @@ -456,7 +489,6 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
>  
>  		n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
>  		n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
> -		hdmi_default_entry = 7;
>  	} else if (IS_HASWELL(dev_priv)) {
>  		ddi_translations_fdi = hsw_ddi_translations_fdi;
>  		ddi_translations_dp = hsw_ddi_translations_dp;
> @@ -464,7 +496,6 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
>  		ddi_translations_hdmi = hsw_ddi_translations_hdmi;
>  		n_dp_entries = n_edp_entries = ARRAY_SIZE(hsw_ddi_translations_dp);
>  		n_hdmi_entries = ARRAY_SIZE(hsw_ddi_translations_hdmi);
> -		hdmi_default_entry = 6;
>  	} else {
>  		WARN(1, "ddi translation table missing\n");
>  		ddi_translations_edp = bdw_ddi_translations_dp;
> @@ -474,7 +505,6 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
>  		n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
>  		n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
>  		n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
> -		hdmi_default_entry = 7;
>  	}
>  
>  	switch (encoder->type) {
> @@ -505,11 +535,6 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
>  	if (encoder->type != INTEL_OUTPUT_HDMI)
>  		return;
>  
> -	/* Choose a good default if VBT is badly populated */
> -	if (hdmi_level == HDMI_LEVEL_SHIFT_UNKNOWN ||
> -	    hdmi_level >= n_hdmi_entries)
> -		hdmi_level = hdmi_default_entry;
> -
>  	/* Entry 9 is for HDMI: */
>  	I915_WRITE(DDI_BUF_TRANS_LO(port, i),
>  		   ddi_translations_hdmi[hdmi_level].trans1 | iboost_bit);
> @@ -1647,6 +1672,10 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
>  			intel_dp_stop_link_train(intel_dp);
>  	} else if (type == INTEL_OUTPUT_HDMI) {
>  		struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
> +		int level = intel_ddi_hdmi_level(dev_priv, port);
> +
> +		if (IS_SKYLAKE(dev_priv) || IS_KABYLAKE(dev_priv))
> +			skl_ddi_set_iboost(intel_encoder, level);
>  
>  		intel_hdmi->set_infoframes(encoder,
>  					   crtc->config->has_hdmi_sink,
> -- 
> 2.7.4
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-07-13 15:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12 12:59 [PATCH 0/9] drm/i915: SKL iboost fixes ville.syrjala
2016-07-12 12:59 ` [PATCH 1/9] drm/i915: Fix iboost setting for DDI with 4 lanes on SKL ville.syrjala
2016-07-13 15:31   ` David Weinehall
2016-07-12 12:59 ` [PATCH 2/9] drm/i915: Name the "iboost bit" ville.syrjala
2016-07-13 15:31   ` David Weinehall
2016-07-12 12:59 ` [PATCH 3/9] drm/i915: Program iboost settings for HDMI/DVI on SKL ville.syrjala
2016-07-13 15:30   ` David Weinehall [this message]
2016-07-12 12:59 ` [PATCH 4/9] drm/i915: Move bxt_ddi_vswing_sequence() call into intel_ddi_pre_enable() for HDMI ville.syrjala
2016-08-01 13:43   ` Imre Deak
2016-07-12 12:59 ` [PATCH 5/9] drm/i915: Explicitly use ddi buf trans entry 9 for hdmi ville.syrjala
2016-07-12 12:59 ` [PATCH 6/9] drm/i915: Split DP/eDP/FDI and HDMI/DVI DDI buffer programming apart ville.syrjala
2016-07-12 12:59 ` [PATCH 7/9] drm/i915: Get the iboost setting based on the port type ville.syrjala
2016-07-12 12:59 ` [PATCH 8/9] drm/i915: Simplify intel_ddi_get_encoder_port() ville.syrjala
2016-07-12 12:59 ` [PATCH 9/9] drm/i915: Extract bdw_get_buf_trans_edp() ville.syrjala
2016-08-01 13:49   ` Imre Deak
2016-07-12 16:41 ` ✓ Ro.CI.BAT: success for drm/i915: SKL iboost fixes Patchwork
2016-08-02 12:13 ` [PATCH 0/9] " Ville Syrjälä

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=20160713153030.GB3839@boom \
    --to=david.weinehall@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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.