drm/i915/cnl: Fix aux selection for WA 1178
authorRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 23 Jan 2018 21:52:45 +0000 (13:52 -0800)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 23 Jan 2018 23:20:57 +0000 (15:20 -0800)
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>
Acked-by: Lucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180123215245.24026-1-rodrigo.vivi@intel.com
drivers/gpu/drm/i915/i915_reg.h

index 3dd72d4bb4e0e78a3ffb8816c28cac24a8d3f130..9c56e2165b2abad5d2a2fefd2dd869b4b6d89d14 100644 (file)
@@ -8420,7 +8420,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