diff mbox

drm/i915/cnl: Add missing type case.

Message ID 20170710205852.28352-1-rodrigo.vivi@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rodrigo Vivi July 10, 2017, 8:58 p.m. UTC
Paulo had noticed that inside cnl_ddi_vswing_program
the case was handling voltage but with no indication
of type where a missing type could also take us to that
path. So my first attempt was to add a message to
let clear who trigger that path.

However DK had a better idea that is to handle the
missed type sooner before it might take to that path.
So this v2 here uses his approach.

v2: Handle missed type sooner.

Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Dhinakaran Pandiyan July 11, 2017, 10:14 a.m. UTC | #1
On Monday, July 10, 2017 1:58:52 PM PDT Rodrigo Vivi wrote:
> Paulo had noticed that inside cnl_ddi_vswing_program
> the case was handling voltage but with no indication
> of type where a missing type could also take us to that
> path. So my first attempt was to add a message to
> let clear who trigger that path.
> 
> However DK had a better idea that is to handle the
> missed type sooner before it might take to that path.
> So this v2 here uses his approach.
> 
> v2: Handle missed type sooner.
> 
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c
> b/drivers/gpu/drm/i915/intel_ddi.c index 241decf2a7d9..efb13582dc73 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1979,9 +1979,12 @@ static void cnl_ddi_vswing_sequence(struct
> intel_encoder *encoder, u32 level) if ((intel_dp) && (type ==
> INTEL_OUTPUT_EDP || type == INTEL_OUTPUT_DP)) { width =
> intel_dp->lane_count;
>  		rate = intel_dp->link_rate;
> -	} else {
> +	} else if (type == INTEL_OUTPUT_HDMI) {
>  		width = 4;
>  		/* Rate is always < than 6GHz for HDMI */
> +	} else {
> +		MISSING_CASE(type);
> +		return;
>  	}
> 
>  	/*

The early return in this version avoids register writes for invalid encoder 
types. So,
Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Rodrigo Vivi July 11, 2017, 2:06 p.m. UTC | #2
On Tue, 2017-07-11 at 03:14 -0700, Dhinakaran Pandiyan wrote:
> On Monday, July 10, 2017 1:58:52 PM PDT Rodrigo Vivi wrote:

> > Paulo had noticed that inside cnl_ddi_vswing_program

> > the case was handling voltage but with no indication

> > of type where a missing type could also take us to that

> > path. So my first attempt was to add a message to

> > let clear who trigger that path.

> > 

> > However DK had a better idea that is to handle the

> > missed type sooner before it might take to that path.

> > So this v2 here uses his approach.

> > 

> > v2: Handle missed type sooner.

> > 

> > Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>

> > Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>

> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

> > ---

> >  drivers/gpu/drm/i915/intel_ddi.c | 5 ++++-

> >  1 file changed, 4 insertions(+), 1 deletion(-)

> > 

> > diff --git a/drivers/gpu/drm/i915/intel_ddi.c

> > b/drivers/gpu/drm/i915/intel_ddi.c index 241decf2a7d9..efb13582dc73 100644

> > --- a/drivers/gpu/drm/i915/intel_ddi.c

> > +++ b/drivers/gpu/drm/i915/intel_ddi.c

> > @@ -1979,9 +1979,12 @@ static void cnl_ddi_vswing_sequence(struct

> > intel_encoder *encoder, u32 level) if ((intel_dp) && (type ==

> > INTEL_OUTPUT_EDP || type == INTEL_OUTPUT_DP)) { width =

> > intel_dp->lane_count;

> >  		rate = intel_dp->link_rate;

> > -	} else {

> > +	} else if (type == INTEL_OUTPUT_HDMI) {

> >  		width = 4;

> >  		/* Rate is always < than 6GHz for HDMI */

> > +	} else {

> > +		MISSING_CASE(type);

> > +		return;

> >  	}

> > 

> >  	/*

> 

> The early return in this version avoids register writes for invalid encoder 

> types. So,

> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>


merged to dinq, thanks for the suggestion and review!

>
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 241decf2a7d9..efb13582dc73 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1979,9 +1979,12 @@  static void cnl_ddi_vswing_sequence(struct intel_encoder *encoder, u32 level)
 	if ((intel_dp) && (type == INTEL_OUTPUT_EDP || type == INTEL_OUTPUT_DP)) {
 		width = intel_dp->lane_count;
 		rate = intel_dp->link_rate;
-	} else {
+	} else if (type == INTEL_OUTPUT_HDMI) {
 		width = 4;
 		/* Rate is always < than 6GHz for HDMI */
+	} else {
+		MISSING_CASE(type);
+		return;
 	}
 
 	/*