]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915: Hide the intel_crtc_needs_color_update() inside intel_color_check()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 23 May 2024 18:28:17 +0000 (21:28 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 27 May 2024 11:30:58 +0000 (14:30 +0300)
Move the intel_crtc_needs_color_update() into intel_color_check()
so that the caller doesn't have to care about this. This will
also enable us to hide the c8_planes_changed() thing better.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240523182818.15382-3-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 dda7c268e2899bcf08fd066ee9abbbf23cea5e84..fab47449918299952d44d6360434dbe2a07d643f 100644 (file)
@@ -1986,6 +1986,11 @@ 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 =
+               intel_atomic_get_new_crtc_state(state, crtc);
+
+       if (!intel_crtc_needs_color_update(new_crtc_state))
+               return 0;
 
        return i915->display.funcs.color->color_check(state, crtc);
 }
index 61c073fc0a46e68e436c642af7d8d552f1dcdc9b..d035a12cbeb0204e60e3787d1ac16db40522c781 100644 (file)
@@ -4254,11 +4254,9 @@ static int intel_crtc_atomic_check(struct intel_atomic_state *state,
        if (c8_planes_changed(crtc_state))
                crtc_state->uapi.color_mgmt_changed = true;
 
-       if (intel_crtc_needs_color_update(crtc_state)) {
-               ret = intel_color_check(state, crtc);
-               if (ret)
-                       return ret;
-       }
+       ret = intel_color_check(state, crtc);
+       if (ret)
+               return ret;
 
        ret = intel_compute_pipe_wm(state, crtc);
        if (ret) {