drm/i915/chv: Fix PORT_TO_PIPE for CHV
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 9 Apr 2014 10:28:55 +0000 (13:28 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 20 May 2014 13:33:00 +0000 (15:33 +0200)
Fix the encoder .get_config hooks to report the correct active pipe for
CHV.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Antti Koskipää <antti.koskipaa@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_hdmi.c

index 9407edb7eb946c7f50fee30090fb8ce71fc206da..019a8a34acd2a52c921f9e9bf104edd390e0256f 100644 (file)
@@ -5132,6 +5132,8 @@ enum punit_power_well {
 #define  PORT_TRANS_SEL_CPT(pipe)      ((pipe) << 29)
 #define  PORT_TO_PIPE(val)     (((val) & (1<<30)) >> 30)
 #define  PORT_TO_PIPE_CPT(val) (((val) & PORT_TRANS_SEL_MASK) >> 29)
+#define  SDVO_PORT_TO_PIPE_CHV(val)    (((val) & (3<<24)) >> 24)
+#define  DP_PORT_TO_PIPE_CHV(val)      (((val) & (3<<16)) >> 16)
 
 #define TRANS_DP_CTL_A         0xe0300
 #define TRANS_DP_CTL_B         0xe1300
index a2801e96b6bbce681f7172aace8d2353dfcb2c44..7f2dc72b65d1f931afd1010378b8f21ad7c7b251 100644 (file)
@@ -1457,6 +1457,8 @@ static bool intel_dp_get_hw_state(struct intel_encoder *encoder,
 
        if (port == PORT_A && IS_GEN7(dev) && !IS_VALLEYVIEW(dev)) {
                *pipe = PORT_TO_PIPE_CPT(tmp);
+       } else if (IS_CHERRYVIEW(dev)) {
+               *pipe = DP_PORT_TO_PIPE_CHV(tmp);
        } else if (!HAS_PCH_CPT(dev) || port == PORT_A) {
                *pipe = PORT_TO_PIPE(tmp);
        } else {
index 166785d597cea811688fc27f2e7dfb0bf4bc4633..6b635f7a86d86e49f1e9c1c8e73fff735ce8d8f5 100644 (file)
@@ -697,6 +697,8 @@ static bool intel_hdmi_get_hw_state(struct intel_encoder *encoder,
 
        if (HAS_PCH_CPT(dev))
                *pipe = PORT_TO_PIPE_CPT(tmp);
+       else if (IS_CHERRYVIEW(dev))
+               *pipe = SDVO_PORT_TO_PIPE_CHV(tmp);
        else
                *pipe = PORT_TO_PIPE(tmp);