mirror of https://gitee.com/openkylin/linux.git
drm/i915: Clean up casts to crtc_state in intel_atomic_commit_tail()
Use old/new_intel_crtc_state, and get rid of all the conversion casts where they don't add anything. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180920102711.4184-2-maarten.lankhorst@linux.intel.com
This commit is contained in:
parent
448626103d
commit
a1cccdcf33
|
@ -12664,8 +12664,9 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
|
||||||
struct intel_atomic_state *intel_state = to_intel_atomic_state(state);
|
struct intel_atomic_state *intel_state = to_intel_atomic_state(state);
|
||||||
struct drm_i915_private *dev_priv = to_i915(dev);
|
struct drm_i915_private *dev_priv = to_i915(dev);
|
||||||
struct drm_crtc_state *old_crtc_state, *new_crtc_state;
|
struct drm_crtc_state *old_crtc_state, *new_crtc_state;
|
||||||
|
struct intel_crtc_state *new_intel_crtc_state, *old_intel_crtc_state;
|
||||||
struct drm_crtc *crtc;
|
struct drm_crtc *crtc;
|
||||||
struct intel_crtc_state *intel_cstate;
|
struct intel_crtc *intel_crtc;
|
||||||
u64 put_domains[I915_MAX_PIPES] = {};
|
u64 put_domains[I915_MAX_PIPES] = {};
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -12677,21 +12678,22 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
|
||||||
intel_display_power_get(dev_priv, POWER_DOMAIN_MODESET);
|
intel_display_power_get(dev_priv, POWER_DOMAIN_MODESET);
|
||||||
|
|
||||||
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
|
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
|
||||||
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
|
old_intel_crtc_state = to_intel_crtc_state(old_crtc_state);
|
||||||
|
new_intel_crtc_state = to_intel_crtc_state(new_crtc_state);
|
||||||
|
intel_crtc = to_intel_crtc(crtc);
|
||||||
|
|
||||||
if (needs_modeset(new_crtc_state) ||
|
if (needs_modeset(new_crtc_state) ||
|
||||||
to_intel_crtc_state(new_crtc_state)->update_pipe) {
|
to_intel_crtc_state(new_crtc_state)->update_pipe) {
|
||||||
|
|
||||||
put_domains[to_intel_crtc(crtc)->pipe] =
|
put_domains[intel_crtc->pipe] =
|
||||||
modeset_get_crtc_power_domains(crtc,
|
modeset_get_crtc_power_domains(crtc,
|
||||||
to_intel_crtc_state(new_crtc_state));
|
new_intel_crtc_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!needs_modeset(new_crtc_state))
|
if (!needs_modeset(new_crtc_state))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
intel_pre_plane_update(to_intel_crtc_state(old_crtc_state),
|
intel_pre_plane_update(old_intel_crtc_state, new_intel_crtc_state);
|
||||||
to_intel_crtc_state(new_crtc_state));
|
|
||||||
|
|
||||||
if (old_crtc_state->active) {
|
if (old_crtc_state->active) {
|
||||||
intel_crtc_disable_planes(crtc, old_crtc_state->plane_mask);
|
intel_crtc_disable_planes(crtc, old_crtc_state->plane_mask);
|
||||||
|
@ -12702,7 +12704,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
|
||||||
*/
|
*/
|
||||||
intel_crtc_disable_pipe_crc(intel_crtc);
|
intel_crtc_disable_pipe_crc(intel_crtc);
|
||||||
|
|
||||||
dev_priv->display.crtc_disable(to_intel_crtc_state(old_crtc_state), state);
|
dev_priv->display.crtc_disable(old_intel_crtc_state, state);
|
||||||
intel_crtc->active = false;
|
intel_crtc->active = false;
|
||||||
intel_fbc_disable(intel_crtc);
|
intel_fbc_disable(intel_crtc);
|
||||||
intel_disable_shared_dpll(intel_crtc);
|
intel_disable_shared_dpll(intel_crtc);
|
||||||
|
@ -12723,7 +12725,7 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
|
||||||
*/
|
*/
|
||||||
if (INTEL_GEN(dev_priv) >= 9)
|
if (INTEL_GEN(dev_priv) >= 9)
|
||||||
dev_priv->display.initial_watermarks(intel_state,
|
dev_priv->display.initial_watermarks(intel_state,
|
||||||
to_intel_crtc_state(new_crtc_state));
|
new_intel_crtc_state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -12783,11 +12785,11 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
|
||||||
* TODO: Move this (and other cleanup) to an async worker eventually.
|
* TODO: Move this (and other cleanup) to an async worker eventually.
|
||||||
*/
|
*/
|
||||||
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
|
for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
|
||||||
intel_cstate = to_intel_crtc_state(new_crtc_state);
|
new_intel_crtc_state = to_intel_crtc_state(new_crtc_state);
|
||||||
|
|
||||||
if (dev_priv->display.optimize_watermarks)
|
if (dev_priv->display.optimize_watermarks)
|
||||||
dev_priv->display.optimize_watermarks(intel_state,
|
dev_priv->display.optimize_watermarks(intel_state,
|
||||||
intel_cstate);
|
new_intel_crtc_state);
|
||||||
}
|
}
|
||||||
|
|
||||||
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
|
for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
|
||||||
|
|
Loading…
Reference in New Issue