diff mbox

drm/i915: Fix eDP low vswing for Broadwell

Message ID 1458117175-13976-1-git-send-email-mika.kahola@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Mika Kahola March 16, 2016, 8:32 a.m. UTC
It was noticed on bug #94087 that module parameter
i915.edp_vswing=2 that should override the VBT setting
to use default voltage swing (400 mV) was not applied
for Broadwell.

This patch provides a fix for this by checking if default
i.e. higher voltage swing is requested to be used and
applies the DDI translations table for DP instead of eDP
(low vswing) table.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94087
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

Comments

Jani Nikula March 16, 2016, 9:49 a.m. UTC | #1
On Wed, 16 Mar 2016, Mika Kahola <mika.kahola@intel.com> wrote:
> [ text/plain ]
> It was noticed on bug #94087 that module parameter
> i915.edp_vswing=2 that should override the VBT setting
> to use default voltage swing (400 mV) was not applied
> for Broadwell.
>
> This patch provides a fix for this by checking if default
> i.e. higher voltage swing is requested to be used and
> applies the DDI translations table for DP instead of eDP
> (low vswing) table.
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94087
> Signed-off-by: Mika Kahola <mika.kahola@intel.com>

cc: stable?

> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 14 ++++++++++++--
>  1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index ab025a5..e30adcd 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -443,9 +443,19 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
>  	} else if (IS_BROADWELL(dev_priv)) {
>  		ddi_translations_fdi = bdw_ddi_translations_fdi;
>  		ddi_translations_dp = bdw_ddi_translations_dp;
> -		ddi_translations_edp = bdw_ddi_translations_edp;
> +
> +		if (dev_priv->edp_low_vswing)
> +			ddi_translations_edp = bdw_ddi_translations_edp;
> +		else
> +			ddi_translations_edp = bdw_ddi_translations_dp;
> +
>  		ddi_translations_hdmi = bdw_ddi_translations_hdmi;
> -		n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
> +
> +		if (dev_priv->edp_low_vswing)
> +			n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
> +		else
> +			n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
> +

Please just put these in one if statement above, instead of having two.

BR,
Jani.

>  		n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
>  		n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
>  		hdmi_default_entry = 7;
Mika Kahola March 16, 2016, 10:47 a.m. UTC | #2
On Wed, 2016-03-16 at 11:49 +0200, Jani Nikula wrote:
> On Wed, 16 Mar 2016, Mika Kahola <mika.kahola@intel.com> wrote:
> > [ text/plain ]
> > It was noticed on bug #94087 that module parameter
> > i915.edp_vswing=2 that should override the VBT setting
> > to use default voltage swing (400 mV) was not applied
> > for Broadwell.
> >
> > This patch provides a fix for this by checking if default
> > i.e. higher voltage swing is requested to be used and
> > applies the DDI translations table for DP instead of eDP
> > (low vswing) table.
> >
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94087
> > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> 
> cc: stable?
> 
> > ---
> >  drivers/gpu/drm/i915/intel_ddi.c | 14 ++++++++++++--
> >  1 file changed, 12 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> > index ab025a5..e30adcd 100644
> > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > @@ -443,9 +443,19 @@ void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
> >  	} else if (IS_BROADWELL(dev_priv)) {
> >  		ddi_translations_fdi = bdw_ddi_translations_fdi;
> >  		ddi_translations_dp = bdw_ddi_translations_dp;
> > -		ddi_translations_edp = bdw_ddi_translations_edp;
> > +
> > +		if (dev_priv->edp_low_vswing)
> > +			ddi_translations_edp = bdw_ddi_translations_edp;
> > +		else
> > +			ddi_translations_edp = bdw_ddi_translations_dp;
> > +
> >  		ddi_translations_hdmi = bdw_ddi_translations_hdmi;
> > -		n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
> > +
> > +		if (dev_priv->edp_low_vswing)
> > +			n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
> > +		else
> > +			n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
> > +
> 
> Please just put these in one if statement above, instead of having two.
> 
Ok, I'll fix those if statements. I'll throw a second version for a
review.

Cheers,
Mika

> BR,
> Jani.
> 
> >  		n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
> >  		n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
> >  		hdmi_default_entry = 7;
>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index ab025a5..e30adcd 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -443,9 +443,19 @@  void intel_prepare_ddi_buffer(struct intel_encoder *encoder)
 	} else if (IS_BROADWELL(dev_priv)) {
 		ddi_translations_fdi = bdw_ddi_translations_fdi;
 		ddi_translations_dp = bdw_ddi_translations_dp;
-		ddi_translations_edp = bdw_ddi_translations_edp;
+
+		if (dev_priv->edp_low_vswing)
+			ddi_translations_edp = bdw_ddi_translations_edp;
+		else
+			ddi_translations_edp = bdw_ddi_translations_dp;
+
 		ddi_translations_hdmi = bdw_ddi_translations_hdmi;
-		n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
+
+		if (dev_priv->edp_low_vswing)
+			n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_edp);
+		else
+			n_edp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
+
 		n_dp_entries = ARRAY_SIZE(bdw_ddi_translations_dp);
 		n_hdmi_entries = ARRAY_SIZE(bdw_ddi_translations_hdmi);
 		hdmi_default_entry = 7;