]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915: Program DB LUT registers before vblank
authorChaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Fri, 23 May 2025 06:20:39 +0000 (11:50 +0530)
committerAnimesh Manna <animesh.manna@intel.com>
Mon, 26 May 2025 07:48:16 +0000 (13:18 +0530)
Double Buffered LUT registers can be programmed in the active region.
This patch implements the MMIO path for it. Program the registers after
evading vblank. The HW latches on to the registers after delayed vblank.
It takes around 1024 cdclk cycles(~one scanline) for this.

Following assumptions have been made while making this change

 - Current vblank evasion time is sufficient for programming
   the LUT registers.
 - Current guardband calculation would be sufficient for the HW
   to latch on to the new values

v2: move loading LUTs to commit_pipe_post_planes() since a vblank
    evasion failure for this is probably less drastic than
    for plane programming. (Ville)

Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
Link: https://lore.kernel.org/r/20250523062041.166468-10-chaitanya.kumar.borah@intel.com
drivers/gpu/drm/i915/display/intel_display.c

index 128b2d865ac378bd49d2fd99e986896eba2edfea..06f58c062b296fd01f38246249c59eae2fd5dcbd 100644 (file)
@@ -6638,6 +6638,7 @@ static void commit_pipe_post_planes(struct intel_atomic_state *state,
        struct intel_display *display = to_intel_display(state);
        const struct intel_crtc_state *new_crtc_state =
                intel_atomic_get_new_crtc_state(state, crtc);
+       bool modeset = intel_crtc_needs_modeset(new_crtc_state);
 
        drm_WARN_ON(display->drm, new_crtc_state->use_dsb);
 
@@ -6646,10 +6647,15 @@ static void commit_pipe_post_planes(struct intel_atomic_state *state,
         * get a catastrophic underrun even if the two operations
         * end up happening in two different frames.
         */
-       if (DISPLAY_VER(display) >= 9 &&
-           !intel_crtc_needs_modeset(new_crtc_state))
+       if (DISPLAY_VER(display) >= 9 && !modeset)
                skl_detach_scalers(NULL, new_crtc_state);
 
+       if (!modeset &&
+           intel_crtc_needs_color_update(new_crtc_state) &&
+           !intel_color_uses_dsb(new_crtc_state) &&
+           HAS_DOUBLE_BUFFERED_LUT(display))
+               intel_color_load_luts(new_crtc_state);
+
        if (intel_crtc_vrr_enabling(state, crtc))
                intel_vrr_enable(new_crtc_state);
 }