drm/i915: Polish intel_shared_dpll_swap_state()
Use swap() instead of hand rolling it in intel_shared_dpll_swap_state(), and pass in the intel_atomic_state instead of drm_atomic_state. Makes the code less convoluted. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190701160550.24205-3-ville.syrjala@linux.intel.com Reviewed-by: Imre Deak <imre.deak@intel.com>
This commit is contained in:
parent
afe0c21b62
commit
13d723a117
|
@ -14187,7 +14187,7 @@ static int intel_atomic_commit(struct drm_device *dev,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
dev_priv->wm.distrust_bios_wm = false;
|
dev_priv->wm.distrust_bios_wm = false;
|
||||||
intel_shared_dpll_swap_state(state);
|
intel_shared_dpll_swap_state(intel_state);
|
||||||
intel_atomic_track_fbs(state);
|
intel_atomic_track_fbs(state);
|
||||||
|
|
||||||
if (intel_state->modeset) {
|
if (intel_state->modeset) {
|
||||||
|
|
|
@ -347,25 +347,20 @@ static void intel_put_dpll(struct intel_atomic_state *state,
|
||||||
* i.e. it also puts the current state into @state, even though there is no
|
* i.e. it also puts the current state into @state, even though there is no
|
||||||
* need for that at this moment.
|
* need for that at this moment.
|
||||||
*/
|
*/
|
||||||
void intel_shared_dpll_swap_state(struct drm_atomic_state *state)
|
void intel_shared_dpll_swap_state(struct intel_atomic_state *state)
|
||||||
{
|
{
|
||||||
struct drm_i915_private *dev_priv = to_i915(state->dev);
|
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
|
||||||
struct intel_shared_dpll_state *shared_dpll;
|
struct intel_shared_dpll_state *shared_dpll = state->shared_dpll;
|
||||||
struct intel_shared_dpll *pll;
|
|
||||||
enum intel_dpll_id i;
|
enum intel_dpll_id i;
|
||||||
|
|
||||||
if (!to_intel_atomic_state(state)->dpll_set)
|
if (!state->dpll_set)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
shared_dpll = to_intel_atomic_state(state)->shared_dpll;
|
|
||||||
for (i = 0; i < dev_priv->num_shared_dpll; i++) {
|
for (i = 0; i < dev_priv->num_shared_dpll; i++) {
|
||||||
struct intel_shared_dpll_state tmp;
|
struct intel_shared_dpll *pll =
|
||||||
|
&dev_priv->shared_dplls[i];
|
||||||
|
|
||||||
pll = &dev_priv->shared_dplls[i];
|
swap(pll->state, shared_dpll[i]);
|
||||||
|
|
||||||
tmp = pll->state;
|
|
||||||
pll->state = shared_dpll[i];
|
|
||||||
shared_dpll[i] = tmp;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,6 @@
|
||||||
(void) (&__a == &__b); \
|
(void) (&__a == &__b); \
|
||||||
__a > __b ? (__a - __b) : (__b - __a); })
|
__a > __b ? (__a - __b) : (__b - __a); })
|
||||||
|
|
||||||
struct drm_atomic_state;
|
|
||||||
struct drm_device;
|
struct drm_device;
|
||||||
struct drm_i915_private;
|
struct drm_i915_private;
|
||||||
struct intel_atomic_state;
|
struct intel_atomic_state;
|
||||||
|
@ -358,7 +357,7 @@ void intel_update_active_dpll(struct intel_atomic_state *state,
|
||||||
void intel_prepare_shared_dpll(const struct intel_crtc_state *crtc_state);
|
void intel_prepare_shared_dpll(const struct intel_crtc_state *crtc_state);
|
||||||
void intel_enable_shared_dpll(const struct intel_crtc_state *crtc_state);
|
void intel_enable_shared_dpll(const struct intel_crtc_state *crtc_state);
|
||||||
void intel_disable_shared_dpll(const struct intel_crtc_state *crtc_state);
|
void intel_disable_shared_dpll(const struct intel_crtc_state *crtc_state);
|
||||||
void intel_shared_dpll_swap_state(struct drm_atomic_state *state);
|
void intel_shared_dpll_swap_state(struct intel_atomic_state *state);
|
||||||
void intel_shared_dpll_init(struct drm_device *dev);
|
void intel_shared_dpll_init(struct drm_device *dev);
|
||||||
|
|
||||||
void intel_dpll_dump_hw_state(struct drm_i915_private *dev_priv,
|
void intel_dpll_dump_hw_state(struct drm_i915_private *dev_priv,
|
||||||
|
|
Loading…
Reference in New Issue