drm/i915: Read out hrawclk from CCK on vlv/chv
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 2 Mar 2016 15:22:16 +0000 (17:22 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Fri, 4 Mar 2016 12:44:09 +0000 (14:44 +0200)
Currently we assume that hrawclk is 200MHz on VLV/CHV. That should
be true always, but just to avoid such asumptions we can read out the
actual frequency from CCK.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1456932138-14004-5-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Imre Deak <imre.deak@intel.com>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_display.c

index 65f9bb9754ab317ef9656bf4174078cb9ed37270..7dfc4007f3fa2aeeb31dcf5d173b34a77078f794 100644 (file)
@@ -786,6 +786,7 @@ enum skl_disp_power_wells {
 #define  DSI_PLL_M1_DIV_MASK                   (0x1ff << 0)
 #define CCK_CZ_CLOCK_CONTROL                   0x62
 #define CCK_DISPLAY_CLOCK_CONTROL              0x6b
+#define CCK_DISPLAY_REF_CLOCK_CONTROL          0x6c
 #define  CCK_TRUNK_FORCE_ON                    (1 << 17)
 #define  CCK_TRUNK_FORCE_OFF                   (1 << 16)
 #define  CCK_FREQUENCY_STATUS                  (0x1f << 8)
index dd9118ba3062d5b55e604430fcbf0a6e52dd81fd..62d36a7b33986f93831935777ec22061d7a82f49 100644 (file)
@@ -178,7 +178,8 @@ intel_pch_rawclk(struct drm_i915_private *dev_priv)
 static int
 intel_vlv_hrawclk(struct drm_i915_private *dev_priv)
 {
-       return 200000;
+       return vlv_get_cck_clock_hpll(dev_priv, "hrawclk",
+                                     CCK_DISPLAY_REF_CLOCK_CONTROL);
 }
 
 static int