drm/i915: Rename intel_shared_dpll_commit() to _swap_state()
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Thu, 29 Dec 2016 15:22:08 +0000 (17:22 +0200)
committerAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Fri, 30 Dec 2016 07:25:59 +0000 (09:25 +0200)
The function intel_shared_dpll_commit() performs the equivalent of
drm_atomic_helper_swap_state() for the shared dpll state, which is not
handled by the helpers. So make it do a full swap of the state and
rename it for consistency.

v2: Fix typo in the commit message. (Durga)
v3: Rebase.
v4: Swap the states instead of just renaming the function. (Daniel)
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Durgadoss R <durgadoss.r@intel.com> (v2)
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> (v3)
Link: http://patchwork.freedesktop.org/patch/msgid/1483024933-3726-3-git-send-email-ander.conselvan.de.oliveira@intel.com
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dpll_mgr.c
drivers/gpu/drm/i915/intel_dpll_mgr.h

index 3545778a6749c35b925897a0523c4ae01ecf5fe9..c803a5b36078f1f5d1a54a4ea33e6e7ba3a6832a 100644 (file)
@@ -14658,7 +14658,7 @@ static int intel_atomic_commit(struct drm_device *dev,
 
        drm_atomic_helper_swap_state(state, true);
        dev_priv->wm.distrust_bios_wm = false;
-       intel_shared_dpll_commit(state);
+       intel_shared_dpll_swap_state(state);
        intel_atomic_track_fbs(state);
 
        if (intel_state->modeset) {
index 1fa32f208a21dbb27b18ca7e6265b4a2af187e42..c6b14afa18f1058572d19a55dd22d36bc7a7a410 100644 (file)
@@ -265,7 +265,7 @@ intel_reference_shared_dpll(struct intel_shared_dpll *pll,
        shared_dpll[pll->id].crtc_mask |= 1 << crtc->pipe;
 }
 
-void intel_shared_dpll_commit(struct drm_atomic_state *state)
+void intel_shared_dpll_swap_state(struct drm_atomic_state *state)
 {
        struct drm_i915_private *dev_priv = to_i915(state->dev);
        struct intel_shared_dpll_config *shared_dpll;
@@ -277,8 +277,13 @@ void intel_shared_dpll_commit(struct drm_atomic_state *state)
 
        shared_dpll = to_intel_atomic_state(state)->shared_dpll;
        for (i = 0; i < dev_priv->num_shared_dpll; i++) {
+               struct intel_shared_dpll_config tmp;
+
                pll = &dev_priv->shared_dplls[i];
+
+               tmp = pll->config;
                pll->config = shared_dpll[i];
+               shared_dpll[i] = tmp;
        }
 }
 
index 99a82c95c294ad25e02b965e77d161c90f1c633a..06d61c5d7856c277a879a2284632568fac2ae3e9 100644 (file)
@@ -152,7 +152,7 @@ void intel_release_shared_dpll(struct intel_shared_dpll *dpll,
 void intel_prepare_shared_dpll(struct intel_crtc *crtc);
 void intel_enable_shared_dpll(struct intel_crtc *crtc);
 void intel_disable_shared_dpll(struct intel_crtc *crtc);
-void intel_shared_dpll_commit(struct drm_atomic_state *state);
+void intel_shared_dpll_swap_state(struct drm_atomic_state *state);
 void intel_shared_dpll_init(struct drm_device *dev);
 
 /* BXT dpll related functions */