]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915: Extract lrr_params_changed()
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 16 Jan 2025 20:16:34 +0000 (22:16 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 21 Jan 2025 15:12:44 +0000 (17:12 +0200)
Pull the "do we actually need a LRR update?" checks into a small
helper for clarity.

Cc: Paz Zcharya <pazz@chromium.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250116201637.22486-6-ville.syrjala@linux.intel.com
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/display/intel_display.c

index d0989a85e59c9a43b65b804a71b3af0db43d7cfc..b5e38137ef4d6a95c9cdddaaae331d774007d122 100644 (file)
@@ -6067,6 +6067,13 @@ static int intel_modeset_checks(struct intel_atomic_state *state)
        return 0;
 }
 
+static bool lrr_params_changed(const struct drm_display_mode *old_adjusted_mode,
+                              const struct drm_display_mode *new_adjusted_mode)
+{
+       return old_adjusted_mode->crtc_vblank_end != new_adjusted_mode->crtc_vblank_end ||
+               old_adjusted_mode->crtc_vtotal != new_adjusted_mode->crtc_vtotal;
+}
+
 static void intel_crtc_check_fastset(const struct intel_crtc_state *old_crtc_state,
                                     struct intel_crtc_state *new_crtc_state)
 {
@@ -6087,8 +6094,8 @@ static void intel_crtc_check_fastset(const struct intel_crtc_state *old_crtc_sta
                                   &new_crtc_state->dp_m_n))
                new_crtc_state->update_m_n = false;
 
-       if ((old_crtc_state->hw.adjusted_mode.crtc_vtotal == new_crtc_state->hw.adjusted_mode.crtc_vtotal &&
-            old_crtc_state->hw.adjusted_mode.crtc_vblank_end == new_crtc_state->hw.adjusted_mode.crtc_vblank_end))
+       if (!lrr_params_changed(&old_crtc_state->hw.adjusted_mode,
+                               &new_crtc_state->hw.adjusted_mode))
                new_crtc_state->update_lrr = false;
 
        if (intel_crtc_needs_modeset(new_crtc_state))