drm/i915: Extract intel_post_plane_update_after_readout()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 16 Sep 2024 15:29:58 +0000 (18:29 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 19 Sep 2024 11:41:43 +0000 (14:41 +0300)
Clean up the main commit_tail() codepath a bit by pulling
the post plane update steps that need to performed after
readout into their own little function
(intel_post_plane_update_after_readout()).

Declutters intel_atomic_commit_tail() a bit, and should
hopefully aid in keeping intel_pre_plane_update() vs.
intel_post_plane_update*() in sync.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240916152958.17332-3-ville.syrjala@linux.intel.com
Reviewed-by: Luca Coelho <luciano.coelho@intel.com>
drivers/gpu/drm/i915/display/intel_display.c

index d1b8891..eb5cacc 100644 (file)
@@ -1177,6 +1177,22 @@ static void intel_post_plane_update(struct intel_atomic_state *state,
                intel_encoders_audio_enable(state, crtc);
 }
 
+static void intel_post_plane_update_after_readout(struct intel_atomic_state *state,
+                                                 struct intel_crtc *crtc)
+{
+       const struct intel_crtc_state *new_crtc_state =
+               intel_atomic_get_new_crtc_state(state, crtc);
+
+       /* Must be done after gamma readout due to HSW split gamma vs. IPS w/a */
+       hsw_ips_post_update(state, crtc);
+
+       /*
+        * Activate DRRS after state readout to avoid
+        * dp_m_n vs. dp_m2_n2 confusion on BDW+.
+        */
+       intel_drrs_activate(new_crtc_state);
+}
+
 static void intel_crtc_enable_flip_done(struct intel_atomic_state *state,
                                        struct intel_crtc *crtc)
 {
@@ -7532,14 +7548,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
 
                intel_modeset_verify_crtc(state, crtc);
 
-               /* Must be done after gamma readout due to HSW split gamma vs. IPS w/a */
-               hsw_ips_post_update(state, crtc);
-
-               /*
-                * Activate DRRS after state readout to avoid
-                * dp_m_n vs. dp_m2_n2 confusion on BDW+.
-                */
-               intel_drrs_activate(new_crtc_state);
+               intel_post_plane_update_after_readout(state, crtc);
 
                /*
                 * DSB cleanup is done in cleanup_work aligning with framebuffer