]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915: Split intel_update_crtc() into two parts
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 7 Sep 2023 12:25:40 +0000 (15:25 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 8 Nov 2023 17:20:20 +0000 (19:20 +0200)
Split intel_update_crtc() into two parts such that the first
part performs all the non-vblank evasion preparatory stuff,
and the second part just does the vblank evasion stuff.

For now we just call these back to back so that there is
no funcitonal change.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230907122541.32261-3-ville.syrjala@linux.intel.com
Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
drivers/gpu/drm/i915/display/intel_display.c

index 4bce36e14da69503d8da89414ded09f845ee8823..bedd338ee9be147c7b3e55dd81418e20e52e655f 100644 (file)
@@ -6760,8 +6760,8 @@ static void intel_enable_crtc(struct intel_atomic_state *state,
        intel_crtc_enable_pipe_crc(crtc);
 }
 
-static void intel_update_crtc(struct intel_atomic_state *state,
-                             struct intel_crtc *crtc)
+static void intel_pre_update_crtc(struct intel_atomic_state *state,
+                                 struct intel_crtc *crtc)
 {
        struct drm_i915_private *i915 = to_i915(state->base.dev);
        const struct intel_crtc_state *old_crtc_state =
@@ -6803,6 +6803,15 @@ static void intel_update_crtc(struct intel_atomic_state *state,
                intel_color_commit_noarm(new_crtc_state);
 
        intel_crtc_planes_update_noarm(state, crtc);
+}
+
+static void intel_update_crtc(struct intel_atomic_state *state,
+                             struct intel_crtc *crtc)
+{
+       const struct intel_crtc_state *old_crtc_state =
+               intel_atomic_get_old_crtc_state(state, crtc);
+       struct intel_crtc_state *new_crtc_state =
+               intel_atomic_get_new_crtc_state(state, crtc);
 
        /* Perform vblank evasion around commit operation */
        intel_pipe_update_start(state, crtc);
@@ -6926,6 +6935,7 @@ static void intel_commit_modeset_enables(struct intel_atomic_state *state)
                        continue;
 
                intel_enable_crtc(state, crtc);
+               intel_pre_update_crtc(state, crtc);
                intel_update_crtc(state, crtc);
        }
 }
@@ -6978,6 +6988,7 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state)
                        entries[pipe] = new_crtc_state->wm.skl.ddb;
                        update_pipes &= ~BIT(pipe);
 
+                       intel_pre_update_crtc(state, crtc);
                        intel_update_crtc(state, crtc);
 
                        /*
@@ -7045,6 +7056,7 @@ static void skl_commit_modeset_enables(struct intel_atomic_state *state)
                entries[pipe] = new_crtc_state->wm.skl.ddb;
                update_pipes &= ~BIT(pipe);
 
+               intel_pre_update_crtc(state, crtc);
                intel_update_crtc(state, crtc);
        }