On Tue, Aug 29, 2017 at 04:22:30PM -0700, Rodrigo Vivi wrote: > On clock recovery this function is called to find out > the max voltage swing level that we could go. > > However gen 9 functions use the old buffer translation tables > to figure that out. That table is not valid for CNL > causing an invalid number of entries and an invalid selection > on the max voltage swing level. > > v2: Let's use same approach that previous platforms. > > Cc: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx> > Cc: Clint Taylor <clinton.a.taylor@xxxxxxxxx> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx> > --- > drivers/gpu/drm/i915/intel_ddi.c | 35 +++++++++++++++++++++++++++++++---- > 1 file changed, 31 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c > index f1757a8e481a..97ff082c28a7 100644 > --- a/drivers/gpu/drm/i915/intel_ddi.c > +++ b/drivers/gpu/drm/i915/intel_ddi.c > @@ -649,6 +649,29 @@ cnl_get_buf_trans_edp(struct drm_i915_private *dev_priv, int *n_entries) > } > } > > +static int cnl_max_level(struct drm_i915_private *dev_priv, > + enum intel_output_type type) > +{ > + int n_entries = 0; > + > + switch (type) { > + case INTEL_OUTPUT_DP: > + cnl_get_buf_trans_dp(dev_priv, &n_entries); > + break; > + case INTEL_OUTPUT_EDP: > + cnl_get_buf_trans_edp(dev_priv, &n_entries); > + break; > + case INTEL_OUTPUT_HDMI: > + cnl_get_buf_trans_hdmi(dev_priv, &n_entries); > + break; > + default: > + MISSING_CASE(type); > + return 0; > + } > + > + return n_entries - 1; > +} > + > static int intel_ddi_hdmi_level(struct drm_i915_private *dev_priv, enum port port) > { > int n_hdmi_entries; > @@ -1879,10 +1902,14 @@ u8 intel_ddi_dp_voltage_max(struct intel_encoder *encoder) > struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); > int n_entries; > > - if (encoder->type == INTEL_OUTPUT_EDP) > - intel_ddi_get_buf_trans_edp(dev_priv, &n_entries); > - else > - intel_ddi_get_buf_trans_dp(dev_priv, &n_entries); > + if (IS_CANNONLAKE(dev_priv)) { > + cnl_max_level(dev_priv, encoder->type); You're not actually using the return value. Also the return value has -1 already applied, whereas here we just need the n_entries w/o -1. > + } else { > + if (encoder->type == INTEL_OUTPUT_EDP) > + intel_ddi_get_buf_trans_edp(dev_priv, &n_entries); > + else > + intel_ddi_get_buf_trans_dp(dev_priv, &n_entries); > + } > > if (WARN_ON(n_entries < 1)) > n_entries = 1; > -- > 2.13.2 -- Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx