]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915: Use intel_crtc_needs_modeset() more
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 31 Oct 2022 21:40:36 +0000 (23:40 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 3 Nov 2022 16:25:47 +0000 (18:25 +0200)
Prefer our own intel_crtc_needs_modeset() wrapper to
drm_atomic_crtc_needs_modeset() whenever we are dealing
with the intel_ types instead of drm_ types. Makes things
a bit neater in general.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20221031214037.1636-1-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_cdclk.c
drivers/gpu/drm/i915/display/intel_color.c
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_fbc.c
drivers/gpu/drm/i915/display/skl_watermark.c
drivers/gpu/drm/i915/intel_pm.c

index eada931cb1c8548918733ba699239be767e9cd1a..8a9031012d744de1114cbf235388a0f77427d2da 100644 (file)
@@ -2755,7 +2755,7 @@ int intel_modeset_calc_cdclk(struct intel_atomic_state *state)
                if (IS_ERR(crtc_state))
                        return PTR_ERR(crtc_state);
 
-               if (drm_atomic_crtc_needs_modeset(&crtc_state->uapi))
+               if (intel_crtc_needs_modeset(crtc_state))
                        pipe = INVALID_PIPE;
        }
 
index 33871bfacee7ebc3dc0368fe7bef30ff407fc33e..458e69578da6e122b8cf31997139f700d1f2a731 100644 (file)
@@ -1239,7 +1239,7 @@ intel_color_add_affected_planes(struct intel_crtc_state *new_crtc_state)
        struct intel_plane *plane;
 
        if (!new_crtc_state->hw.active ||
-           drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi))
+           intel_crtc_needs_modeset(new_crtc_state))
                return 0;
 
        if (new_crtc_state->gamma_enable == old_crtc_state->gamma_enable &&
index 31e91dbaa368ab0b2552e9c0b318ae0c870731f4..c4d31db935fe10c7c14b9a3f86a8b8d1cd03e34d 100644 (file)
@@ -5931,7 +5931,7 @@ int intel_modeset_all_pipes(struct intel_atomic_state *state,
                        return PTR_ERR(crtc_state);
 
                if (!crtc_state->hw.active ||
-                   drm_atomic_crtc_needs_modeset(&crtc_state->uapi))
+                   intel_crtc_needs_modeset(crtc_state))
                        continue;
 
                drm_dbg_kms(&dev_priv->drm, "[CRTC:%d:%s] Full modeset due to %s\n",
index 3f24f326b9890c937a405effc45a2d39ed9d115a..b5ee5ea0d010e077dd84269d757fe2cf595ba9ef 100644 (file)
@@ -1183,7 +1183,7 @@ static bool intel_fbc_can_flip_nuke(struct intel_atomic_state *state,
        const struct drm_framebuffer *old_fb = old_plane_state->hw.fb;
        const struct drm_framebuffer *new_fb = new_plane_state->hw.fb;
 
-       if (drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi))
+       if (intel_crtc_needs_modeset(new_crtc_state))
                return false;
 
        if (!intel_fbc_is_ok(old_plane_state) ||
index d58e667016e465351b9669c40b56f52a80cea7d5..e0766d1be966ff5dc135404d524a898292f395eb 100644 (file)
@@ -2744,7 +2744,7 @@ static int skl_wm_add_affected_planes(struct intel_atomic_state *state,
                 * power well the hardware state will go out of sync
                 * with the software state.
                 */
-               if (!drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi) &&
+               if (!intel_crtc_needs_modeset(new_crtc_state) &&
                    skl_plane_selected_wm_equals(plane,
                                                 &old_crtc_state->wm.skl.optimal,
                                                 &new_crtc_state->wm.skl.optimal))
index a204a32bce44aab82676c9c8f52299843ce6c2b3..016ac568dc874a9762236795f0f9c55c09b012af 100644 (file)
@@ -1434,7 +1434,7 @@ static int g4x_compute_intermediate_wm(struct intel_atomic_state *state,
        enum plane_id plane_id;
 
        if (!new_crtc_state->hw.active ||
-           drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) {
+           intel_crtc_needs_modeset(new_crtc_state)) {
                *intermediate = *optimal;
 
                intermediate->cxsr = false;
@@ -1922,7 +1922,6 @@ static int vlv_compute_pipe_wm(struct intel_atomic_state *state,
 {
        struct intel_crtc_state *crtc_state =
                intel_atomic_get_new_crtc_state(state, crtc);
-       bool needs_modeset = drm_atomic_crtc_needs_modeset(&crtc_state->uapi);
        const struct intel_plane_state *old_plane_state;
        const struct intel_plane_state *new_plane_state;
        struct intel_plane *plane;
@@ -1949,7 +1948,7 @@ static int vlv_compute_pipe_wm(struct intel_atomic_state *state,
         * FIFO setting we took over from the BIOS even if there
         * are no active planes on the crtc.
         */
-       if (needs_modeset)
+       if (intel_crtc_needs_modeset(crtc_state))
                dirty = ~0;
 
        if (!dirty)
@@ -1969,7 +1968,7 @@ static int vlv_compute_pipe_wm(struct intel_atomic_state *state,
                if (ret)
                        return ret;
 
-               if (needs_modeset ||
+               if (intel_crtc_needs_modeset(crtc_state) ||
                    memcmp(old_fifo_state, new_fifo_state,
                           sizeof(*new_fifo_state)) != 0)
                        crtc_state->fifo_changed = true;
@@ -2092,7 +2091,7 @@ static int vlv_compute_intermediate_wm(struct intel_atomic_state *state,
        int level;
 
        if (!new_crtc_state->hw.active ||
-           drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi)) {
+           intel_crtc_needs_modeset(new_crtc_state)) {
                *intermediate = *optimal;
 
                intermediate->cxsr = false;
@@ -3150,7 +3149,7 @@ static int ilk_compute_intermediate_wm(struct intel_atomic_state *state,
         */
        *a = new_crtc_state->wm.ilk.optimal;
        if (!new_crtc_state->hw.active ||
-           drm_atomic_crtc_needs_modeset(&new_crtc_state->uapi) ||
+           intel_crtc_needs_modeset(new_crtc_state) ||
            state->skip_intermediate_wm)
                return 0;