diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-04-09 08:46:55 -0400 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-04-09 10:03:11 -0400 |
commit | 8b69449d26637551c4145731e684cf1bb2478393 (patch) | |
tree | 86544b7b0aaa75ac75d16423e9b23ca0f2ca1dc6 | |
parent | 70c7183fbe96a42292df598288d32c2a172ff12f (diff) |
drm/i915: Remove last references to drm_atomic_get_existing* macros
All the references to get_existing_state can be converted to
get_new_state or get_old_state, which means that i915 is now
get_existing_state free.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180409124656.39886-3-maarten.lankhorst@linux.intel.com
[mlankhorst: Fix alignment in prepare_plane_fb. (Ville)]
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 53 |
1 files changed, 24 insertions, 29 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index fec3d6dd5c60..8fe805983be8 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -5148,8 +5148,8 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state) | |||
5148 | intel_atomic_get_new_crtc_state(to_intel_atomic_state(old_state), | 5148 | intel_atomic_get_new_crtc_state(to_intel_atomic_state(old_state), |
5149 | crtc); | 5149 | crtc); |
5150 | struct drm_plane *primary = crtc->base.primary; | 5150 | struct drm_plane *primary = crtc->base.primary; |
5151 | struct drm_plane_state *old_pri_state = | 5151 | struct drm_plane_state *old_primary_state = |
5152 | drm_atomic_get_existing_plane_state(old_state, primary); | 5152 | drm_atomic_get_old_plane_state(old_state, primary); |
5153 | 5153 | ||
5154 | intel_frontbuffer_flip(to_i915(crtc->base.dev), pipe_config->fb_bits); | 5154 | intel_frontbuffer_flip(to_i915(crtc->base.dev), pipe_config->fb_bits); |
5155 | 5155 | ||
@@ -5159,19 +5159,16 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state) | |||
5159 | if (hsw_post_update_enable_ips(old_crtc_state, pipe_config)) | 5159 | if (hsw_post_update_enable_ips(old_crtc_state, pipe_config)) |
5160 | hsw_enable_ips(pipe_config); | 5160 | hsw_enable_ips(pipe_config); |
5161 | 5161 | ||
5162 | if (old_pri_state) { | 5162 | if (old_primary_state) { |
5163 | struct intel_plane_state *primary_state = | 5163 | struct drm_plane_state *new_primary_state = |
5164 | intel_atomic_get_new_plane_state(to_intel_atomic_state(old_state), | 5164 | drm_atomic_get_new_plane_state(old_state, primary); |
5165 | to_intel_plane(primary)); | 5165 | struct drm_framebuffer *fb = new_primary_state->fb; |
5166 | struct intel_plane_state *old_primary_state = | ||
5167 | to_intel_plane_state(old_pri_state); | ||
5168 | struct drm_framebuffer *fb = primary_state->base.fb; | ||
5169 | 5166 | ||
5170 | intel_fbc_post_update(crtc); | 5167 | intel_fbc_post_update(crtc); |
5171 | 5168 | ||
5172 | if (primary_state->base.visible && | 5169 | if (new_primary_state->visible && |
5173 | (needs_modeset(&pipe_config->base) || | 5170 | (needs_modeset(&pipe_config->base) || |
5174 | !old_primary_state->base.visible)) | 5171 | !old_primary_state->visible)) |
5175 | intel_post_enable_primary(&crtc->base, pipe_config); | 5172 | intel_post_enable_primary(&crtc->base, pipe_config); |
5176 | 5173 | ||
5177 | /* Display WA 827 */ | 5174 | /* Display WA 827 */ |
@@ -5192,8 +5189,8 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state, | |||
5192 | struct drm_i915_private *dev_priv = to_i915(dev); | 5189 | struct drm_i915_private *dev_priv = to_i915(dev); |
5193 | struct drm_atomic_state *old_state = old_crtc_state->base.state; | 5190 | struct drm_atomic_state *old_state = old_crtc_state->base.state; |
5194 | struct drm_plane *primary = crtc->base.primary; | 5191 | struct drm_plane *primary = crtc->base.primary; |
5195 | struct drm_plane_state *old_pri_state = | 5192 | struct drm_plane_state *old_primary_state = |
5196 | drm_atomic_get_existing_plane_state(old_state, primary); | 5193 | drm_atomic_get_old_plane_state(old_state, primary); |
5197 | bool modeset = needs_modeset(&pipe_config->base); | 5194 | bool modeset = needs_modeset(&pipe_config->base); |
5198 | struct intel_atomic_state *old_intel_state = | 5195 | struct intel_atomic_state *old_intel_state = |
5199 | to_intel_atomic_state(old_state); | 5196 | to_intel_atomic_state(old_state); |
@@ -5201,13 +5198,11 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state, | |||
5201 | if (hsw_pre_update_disable_ips(old_crtc_state, pipe_config)) | 5198 | if (hsw_pre_update_disable_ips(old_crtc_state, pipe_config)) |
5202 | hsw_disable_ips(old_crtc_state); | 5199 | hsw_disable_ips(old_crtc_state); |
5203 | 5200 | ||
5204 | if (old_pri_state) { | 5201 | if (old_primary_state) { |
5205 | struct intel_plane_state *primary_state = | 5202 | struct intel_plane_state *new_primary_state = |
5206 | intel_atomic_get_new_plane_state(old_intel_state, | 5203 | intel_atomic_get_new_plane_state(old_intel_state, |
5207 | to_intel_plane(primary)); | 5204 | to_intel_plane(primary)); |
5208 | struct intel_plane_state *old_primary_state = | 5205 | struct drm_framebuffer *fb = new_primary_state->base.fb; |
5209 | to_intel_plane_state(old_pri_state); | ||
5210 | struct drm_framebuffer *fb = primary_state->base.fb; | ||
5211 | 5206 | ||
5212 | /* Display WA 827 */ | 5207 | /* Display WA 827 */ |
5213 | if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv)) || | 5208 | if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv)) || |
@@ -5216,13 +5211,13 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state, | |||
5216 | skl_wa_clkgate(dev_priv, crtc->pipe, true); | 5211 | skl_wa_clkgate(dev_priv, crtc->pipe, true); |
5217 | } | 5212 | } |
5218 | 5213 | ||
5219 | intel_fbc_pre_update(crtc, pipe_config, primary_state); | 5214 | intel_fbc_pre_update(crtc, pipe_config, new_primary_state); |
5220 | /* | 5215 | /* |
5221 | * Gen2 reports pipe underruns whenever all planes are disabled. | 5216 | * Gen2 reports pipe underruns whenever all planes are disabled. |
5222 | * So disable underrun reporting before all the planes get disabled. | 5217 | * So disable underrun reporting before all the planes get disabled. |
5223 | */ | 5218 | */ |
5224 | if (IS_GEN2(dev_priv) && old_primary_state->base.visible && | 5219 | if (IS_GEN2(dev_priv) && old_primary_state->visible && |
5225 | (modeset || !primary_state->base.visible)) | 5220 | (modeset || !new_primary_state->base.visible)) |
5226 | intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, false); | 5221 | intel_set_cpu_fifo_underrun_reporting(dev_priv, crtc->pipe, false); |
5227 | } | 5222 | } |
5228 | 5223 | ||
@@ -10834,7 +10829,7 @@ static bool check_digital_port_conflicts(struct drm_atomic_state *state) | |||
10834 | struct drm_connector_state *connector_state; | 10829 | struct drm_connector_state *connector_state; |
10835 | struct intel_encoder *encoder; | 10830 | struct intel_encoder *encoder; |
10836 | 10831 | ||
10837 | connector_state = drm_atomic_get_existing_connector_state(state, connector); | 10832 | connector_state = drm_atomic_get_new_connector_state(state, connector); |
10838 | if (!connector_state) | 10833 | if (!connector_state) |
10839 | connector_state = connector->state; | 10834 | connector_state = connector->state; |
10840 | 10835 | ||
@@ -12197,6 +12192,9 @@ static void intel_update_crtc(struct drm_crtc *crtc, | |||
12197 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); | 12192 | struct intel_crtc *intel_crtc = to_intel_crtc(crtc); |
12198 | struct intel_crtc_state *pipe_config = to_intel_crtc_state(new_crtc_state); | 12193 | struct intel_crtc_state *pipe_config = to_intel_crtc_state(new_crtc_state); |
12199 | bool modeset = needs_modeset(new_crtc_state); | 12194 | bool modeset = needs_modeset(new_crtc_state); |
12195 | struct intel_plane_state *new_plane_state = | ||
12196 | intel_atomic_get_new_plane_state(to_intel_atomic_state(state), | ||
12197 | to_intel_plane(crtc->primary)); | ||
12200 | 12198 | ||
12201 | if (modeset) { | 12199 | if (modeset) { |
12202 | update_scanline_offset(intel_crtc); | 12200 | update_scanline_offset(intel_crtc); |
@@ -12209,11 +12207,8 @@ static void intel_update_crtc(struct drm_crtc *crtc, | |||
12209 | pipe_config); | 12207 | pipe_config); |
12210 | } | 12208 | } |
12211 | 12209 | ||
12212 | if (drm_atomic_get_existing_plane_state(state, crtc->primary)) { | 12210 | if (new_plane_state) |
12213 | intel_fbc_enable( | 12211 | intel_fbc_enable(intel_crtc, pipe_config, new_plane_state); |
12214 | intel_crtc, pipe_config, | ||
12215 | to_intel_plane_state(crtc->primary->state)); | ||
12216 | } | ||
12217 | 12212 | ||
12218 | drm_atomic_helper_commit_planes_on_crtc(old_crtc_state); | 12213 | drm_atomic_helper_commit_planes_on_crtc(old_crtc_state); |
12219 | } | 12214 | } |
@@ -12794,8 +12789,8 @@ intel_prepare_plane_fb(struct drm_plane *plane, | |||
12794 | 12789 | ||
12795 | if (old_obj) { | 12790 | if (old_obj) { |
12796 | struct drm_crtc_state *crtc_state = | 12791 | struct drm_crtc_state *crtc_state = |
12797 | drm_atomic_get_existing_crtc_state(new_state->state, | 12792 | drm_atomic_get_new_crtc_state(new_state->state, |
12798 | plane->state->crtc); | 12793 | plane->state->crtc); |
12799 | 12794 | ||
12800 | /* Big Hammer, we also need to ensure that any pending | 12795 | /* Big Hammer, we also need to ensure that any pending |
12801 | * MI_WAIT_FOR_EVENT inside a user batch buffer on the | 12796 | * MI_WAIT_FOR_EVENT inside a user batch buffer on the |