]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915: Bury c8_planes_changed() in intel_color_check()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 23 May 2024 18:28:18 +0000 (21:28 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 27 May 2024 11:31:44 +0000 (14:31 +0300)
The c8_planes_changed() check in the high level atomic code is
a bit of an eyesore. Push it inside intel_color_check() so the
high level code doesn't have to care about this stuff.

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

index fab47449918299952d44d6360434dbe2a07d643f..9173caba3f0f56b3eaeed169aa38780933a5d7ed 100644 (file)
@@ -1986,9 +1986,18 @@ int intel_color_check(struct intel_atomic_state *state,
                      struct intel_crtc *crtc)
 {
        struct drm_i915_private *i915 = to_i915(state->base.dev);
-       const struct intel_crtc_state *new_crtc_state =
+       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);
 
+       /*
+        * May need to update pipe gamma enable bits
+        * when C8 planes are getting enabled/disabled.
+        */
+       if (!old_crtc_state->c8_planes != !new_crtc_state->c8_planes)
+               new_crtc_state->uapi.color_mgmt_changed = true;
+
        if (!intel_crtc_needs_color_update(new_crtc_state))
                return 0;
 
index d035a12cbeb0204e60e3787d1ac16db40522c781..071ba95a1472824b137cb0e58b07c4a5e45684bb 100644 (file)
@@ -4138,17 +4138,6 @@ static int icl_check_nv12_planes(struct intel_crtc_state *crtc_state)
        return 0;
 }
 
-static bool c8_planes_changed(const struct intel_crtc_state *new_crtc_state)
-{
-       struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
-       struct intel_atomic_state *state =
-               to_intel_atomic_state(new_crtc_state->uapi.state);
-       const struct intel_crtc_state *old_crtc_state =
-               intel_atomic_get_old_crtc_state(state, crtc);
-
-       return !old_crtc_state->c8_planes != !new_crtc_state->c8_planes;
-}
-
 static u16 hsw_linetime_wm(const struct intel_crtc_state *crtc_state)
 {
        const struct drm_display_mode *pipe_mode =
@@ -4247,13 +4236,6 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,
                        return ret;
        }
 
-       /*
-        * May need to update pipe gamma enable bits
-        * when C8 planes are getting enabled/disabled.
-        */
-       if (c8_planes_changed(crtc_state))
-               crtc_state->uapi.color_mgmt_changed = true;
-
        ret = intel_color_check(state, crtc);
        if (ret)
                return ret;