drm/i915/dpll: move dpll modeset asserts to intel_dpll.c
authorJani Nikula <jani.nikula@intel.com>
Thu, 30 Sep 2021 09:23:00 +0000 (12:23 +0300)
committerJani Nikula <jani.nikula@intel.com>
Fri, 1 Oct 2021 07:48:59 +0000 (10:48 +0300)
Keep the functionality and the assert code together.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/0229659fb8af6c91c774408c6f7bb8c4ff8735e3.1632992608.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_color.c
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_display.h
drivers/gpu/drm/i915/display/intel_display_power.c
drivers/gpu/drm/i915/display/intel_dpll.c
drivers/gpu/drm/i915/display/intel_dpll.h
drivers/gpu/drm/i915/display/intel_lvds.c

index f5923f1c38bdd3844197e923a64b4f244d23efa3..34463aeec25ccfe57de1f901cff33696cb3c3d0c 100644 (file)
@@ -25,6 +25,7 @@
 #include "intel_color.h"
 #include "intel_de.h"
 #include "intel_display_types.h"
+#include "intel_dpll.h"
 
 #define CTM_COEFF_SIGN (1ULL << 63)
 
index 34201e71593bcf06898e878d15d06496facc4d7c..9d2b6bd94d366acc99ecacc3e84dba009682773c 100644 (file)
@@ -398,20 +398,6 @@ intel_wait_for_pipe_off(const struct intel_crtc_state *old_crtc_state)
        }
 }
 
-/* Only for pre-ILK configs */
-void assert_pll(struct drm_i915_private *dev_priv,
-               enum pipe pipe, bool state)
-{
-       u32 val;
-       bool cur_state;
-
-       val = intel_de_read(dev_priv, DPLL(pipe));
-       cur_state = !!(val & DPLL_VCO_ENABLE);
-       I915_STATE_WARN(cur_state != state,
-            "PLL state assertion failure (expected %s, current %s)\n",
-                       onoff(state), onoff(cur_state));
-}
-
 /* XXX: the dsi pll is shared between MIPI DSI ports */
 void assert_dsi_pll(struct drm_i915_private *dev_priv, bool state)
 {
index 5306d119b2c035ca747cffed2394646028f8bbd4..b3ccec541aa008249b69eb7255fb347774eda835 100644 (file)
@@ -645,10 +645,6 @@ void intel_init_pch_refclk(struct drm_i915_private *dev_priv);
 int intel_modeset_all_pipes(struct intel_atomic_state *state);
 
 /* modesetting asserts */
-void assert_pll(struct drm_i915_private *dev_priv,
-               enum pipe pipe, bool state);
-#define assert_pll_enabled(d, p) assert_pll(d, p, true)
-#define assert_pll_disabled(d, p) assert_pll(d, p, false)
 void assert_dsi_pll(struct drm_i915_private *dev_priv, bool state);
 #define assert_dsi_pll_enabled(d) assert_dsi_pll(d, true)
 #define assert_dsi_pll_disabled(d) assert_dsi_pll(d, false)
index 2410c1a617ea6e887a45abed87e371b7489894fe..06e9879aedd7d04f95532a6cefcdf50a6ddb0788 100644 (file)
@@ -9,11 +9,12 @@
 #include "i915_irq.h"
 #include "intel_cdclk.h"
 #include "intel_combo_phy.h"
-#include "intel_display_power.h"
 #include "intel_de.h"
+#include "intel_display_power.h"
 #include "intel_display_types.h"
 #include "intel_dmc.h"
 #include "intel_dpio_phy.h"
+#include "intel_dpll.h"
 #include "intel_hotplug.h"
 #include "intel_pm.h"
 #include "intel_pps.h"
index 66784204f6f75e9f270b32be0210e1659f91f1f6..b84ed4a1bd95ba13cafe22034ade48b824d2297f 100644 (file)
@@ -1923,3 +1923,25 @@ void vlv_force_pll_off(struct drm_i915_private *dev_priv, enum pipe pipe)
        else
                vlv_disable_pll(dev_priv, pipe);
 }
+
+/* Only for pre-ILK configs */
+static void assert_pll(struct drm_i915_private *dev_priv,
+                      enum pipe pipe, bool state)
+{
+       bool cur_state;
+
+       cur_state = intel_de_read(dev_priv, DPLL(pipe)) & DPLL_VCO_ENABLE;
+       I915_STATE_WARN(cur_state != state,
+                       "PLL state assertion failure (expected %s, current %s)\n",
+                       onoff(state), onoff(cur_state));
+}
+
+void assert_pll_enabled(struct drm_i915_private *i915, enum pipe pipe)
+{
+       assert_pll(i915, pipe, true);
+}
+
+void assert_pll_disabled(struct drm_i915_private *i915, enum pipe pipe)
+{
+       assert_pll(i915, pipe, false);
+}
index db396b3e114112a1ad4a8070981329ea9ce1d37f..1af0ac43cca45e31c9d6adb351e3a99c3db0bb72 100644 (file)
@@ -36,4 +36,7 @@ bool bxt_find_best_dpll(struct intel_crtc_state *crtc_state,
                        struct dpll *best_clock);
 int chv_calc_dpll_params(int refclk, struct dpll *pll_clock);
 
+void assert_pll_enabled(struct drm_i915_private *i915, enum pipe pipe);
+void assert_pll_disabled(struct drm_i915_private *i915, enum pipe pipe);
+
 #endif
index 6155eb0c0a5c50df379d6d74ef44b530bf4acff8..9fced37bed70464a9e28db12643dcbcae8fcef66 100644 (file)
@@ -44,6 +44,7 @@
 #include "intel_connector.h"
 #include "intel_de.h"
 #include "intel_display_types.h"
+#include "intel_dpll.h"
 #include "intel_fdi.h"
 #include "intel_gmbus.h"
 #include "intel_lvds.h"