diff mbox

drm/i915/cnl: Fix aux selection for WA 1178

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

Commit Message

Rodrigo Vivi Jan. 23, 2018, 9:52 p.m. UTC
Current code always select _CNL_AUX_ANAOVRD1_B
register regardless the pw in use.

CNL_DISP_PW_AUX_B = 9
CNL_DISP_PW_AUX_C = 10
CNL_DISP_PW_AUX_D = 11

And for pick we want

B = 0
C = 1
D = 2

Fixes: ddd39e4b3f8f ("drm/i915/cnl: apply Display WA #1178 to fix type C dongles")
Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Lucas De Marchi Jan. 23, 2018, 11:13 p.m. UTC | #1
On Tue, Jan 23, 2018 at 01:52:45PM -0800, Rodrigo Vivi wrote:
> Current code always select _CNL_AUX_ANAOVRD1_B
> register regardless the pw in use.
> 
> CNL_DISP_PW_AUX_B = 9
> CNL_DISP_PW_AUX_C = 10
> CNL_DISP_PW_AUX_D = 11
> 
> And for pick we want
> 
> B = 0
> C = 1
> D = 2
> 
> Fixes: ddd39e4b3f8f ("drm/i915/cnl: apply Display WA #1178 to fix type C dongles")
> Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_reg.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> index abd9ee876186..42ced2f3ae7e 100644
> --- a/drivers/gpu/drm/i915/i915_reg.h
> +++ b/drivers/gpu/drm/i915/i915_reg.h
> @@ -8422,7 +8422,7 @@ enum skl_power_gate {
>  #define  SKL_PW_TO_PG(pw)			((pw) - SKL_DISP_PW_1 + SKL_PG1)
>  #define  SKL_FUSE_PG_DIST_STATUS(pg)		(1 << (27 - (pg)))
>  
> -#define _CNL_AUX_REG_IDX(pw)		((pw - 1) >> 4)
> +#define _CNL_AUX_REG_IDX(pw)		((pw) - 9)

Ugh, I guess I based this on the _HSW_PW_REG_IDX() macro and made a
complete mess out of it, sorry.

Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>


Lucas De Marchi
Rodrigo Vivi Jan. 23, 2018, 11:22 p.m. UTC | #2
On Tue, Jan 23, 2018 at 11:13:14PM +0000, Lucas De Marchi wrote:
> On Tue, Jan 23, 2018 at 01:52:45PM -0800, Rodrigo Vivi wrote:
> > Current code always select _CNL_AUX_ANAOVRD1_B
> > register regardless the pw in use.
> > 
> > CNL_DISP_PW_AUX_B = 9
> > CNL_DISP_PW_AUX_C = 10
> > CNL_DISP_PW_AUX_D = 11
> > 
> > And for pick we want
> > 
> > B = 0
> > C = 1
> > D = 2
> > 
> > Fixes: ddd39e4b3f8f ("drm/i915/cnl: apply Display WA #1178 to fix type C dongles")
> > Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_reg.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
> > index abd9ee876186..42ced2f3ae7e 100644
> > --- a/drivers/gpu/drm/i915/i915_reg.h
> > +++ b/drivers/gpu/drm/i915/i915_reg.h
> > @@ -8422,7 +8422,7 @@ enum skl_power_gate {
> >  #define  SKL_PW_TO_PG(pw)			((pw) - SKL_DISP_PW_1 + SKL_PG1)
> >  #define  SKL_FUSE_PG_DIST_STATUS(pg)		(1 << (27 - (pg)))
> >  
> > -#define _CNL_AUX_REG_IDX(pw)		((pw - 1) >> 4)
> > +#define _CNL_AUX_REG_IDX(pw)		((pw) - 9)
> 
> Ugh, I guess I based this on the _HSW_PW_REG_IDX() macro and made a
> complete mess out of it, sorry.

whatever you did back there I fully agreed, so my bad as well

> 
> Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>

merged. thanks.

> 
> 
> Lucas De Marchi
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index abd9ee876186..42ced2f3ae7e 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -8422,7 +8422,7 @@  enum skl_power_gate {
 #define  SKL_PW_TO_PG(pw)			((pw) - SKL_DISP_PW_1 + SKL_PG1)
 #define  SKL_FUSE_PG_DIST_STATUS(pg)		(1 << (27 - (pg)))
 
-#define _CNL_AUX_REG_IDX(pw)		((pw - 1) >> 4)
+#define _CNL_AUX_REG_IDX(pw)		((pw) - 9)
 #define _CNL_AUX_ANAOVRD1_B		0x162250
 #define _CNL_AUX_ANAOVRD1_C		0x162210
 #define _CNL_AUX_ANAOVRD1_D		0x1622D0