drm/i915: Move crtc_state to tighter scope
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 18 Nov 2019 16:44:24 +0000 (18:44 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 20 Nov 2019 15:43:47 +0000 (17:43 +0200)
intel_modeset_setup_hw_state() doesn't need the crtc_state at the
top level scope. Move it to where it's needed.

Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191118164430.27265-5-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/intel_display.c

index 548105659ffab425b69def81477db7076ee367f2..671d3e06cbab851cf66b5eafca93a956e3a02d79 100644 (file)
@@ -17790,7 +17790,6 @@ intel_modeset_setup_hw_state(struct drm_device *dev,
                             struct drm_modeset_acquire_ctx *ctx)
 {
        struct drm_i915_private *dev_priv = to_i915(dev);
-       struct intel_crtc_state *crtc_state;
        struct intel_encoder *encoder;
        struct intel_crtc *crtc;
        intel_wakeref_t wakeref;
@@ -17823,7 +17822,8 @@ intel_modeset_setup_hw_state(struct drm_device *dev,
         * waits, so we need vblank interrupts restored beforehand.
         */
        for_each_intel_crtc(&dev_priv->drm, crtc) {
-               crtc_state = to_intel_crtc_state(crtc->base.state);
+               struct intel_crtc_state *crtc_state =
+                       to_intel_crtc_state(crtc->base.state);
 
                drm_crtc_vblank_reset(&crtc->base);
 
@@ -17837,7 +17837,9 @@ intel_modeset_setup_hw_state(struct drm_device *dev,
                intel_sanitize_encoder(encoder);
 
        for_each_intel_crtc(&dev_priv->drm, crtc) {
-               crtc_state = to_intel_crtc_state(crtc->base.state);
+               struct intel_crtc_state *crtc_state =
+                       crtc_state = to_intel_crtc_state(crtc->base.state);
+
                intel_sanitize_crtc(crtc, ctx);
                intel_dump_pipe_config(crtc_state, NULL, "[setup_hw_state]");
        }
@@ -17870,9 +17872,10 @@ intel_modeset_setup_hw_state(struct drm_device *dev,
        }
 
        for_each_intel_crtc(dev, crtc) {
+               struct intel_crtc_state *crtc_state =
+                       to_intel_crtc_state(crtc->base.state);
                u64 put_domains;
 
-               crtc_state = to_intel_crtc_state(crtc->base.state);
                put_domains = modeset_get_crtc_power_domains(crtc_state);
                if (WARN_ON(put_domains))
                        modeset_put_power_domains(dev_priv, put_domains);