On Mon, Apr 07, 2025 at 07:53:57PM +0530, Chaitanya Kumar Borah wrote: > 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 > > Signed-off-by: Chaitanya Kumar Borah <[email protected]> > --- > drivers/gpu/drm/i915/display/intel_display.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > b/drivers/gpu/drm/i915/display/intel_display.c > index 85e28b4c9e66..df9c992d2939 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -6725,10 +6725,12 @@ static void intel_pre_update_crtc(struct > intel_atomic_state *state, > static void intel_update_crtc(struct intel_atomic_state *state, > struct intel_crtc *crtc) > { > + struct intel_display *display = to_intel_display(crtc); > 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); > + bool modeset = intel_crtc_needs_modeset(new_crtc_state); > > if (new_crtc_state->use_dsb) { > intel_crtc_prepare_vblank_event(new_crtc_state, > &crtc->dsb_event); > @@ -6738,6 +6740,12 @@ static void intel_update_crtc(struct > intel_atomic_state *state, > /* Perform vblank evasion around commit operation */ > intel_pipe_update_start(state, crtc); > > + if (!modeset && > + intel_crtc_needs_color_update(new_crtc_state) && > + !new_crtc_state->dsb_color && > + HAS_DOUBLE_BUFFERED_LUT(display)) > + intel_color_load_luts(new_crtc_state); > +
I think we want to do this in commit_pipe_post_planes() since a vblank evasion failure for this is probably less drastic than for plane programming. > if (new_crtc_state->dsb_commit) > intel_dsb_commit(new_crtc_state->dsb_commit, false); > > -- > 2.25.1 -- Ville Syrjälä Intel
