Skip to content

Commit 08222ca

Browse files
committed
drm/i915/dsb: Introduce intel_dsb_wait_vblank_delay()
Add intel_dsb_wait_vblank_delay() which instructs the DSB to wait for duration between the undelayed and delayed vblanks. We'll need this as the DSB can only directly wait for the undelayed vblank, but we'll need to wait until the delayed vblank has elapsed as well. Reviewed-by: Animesh Manna <animesh.manna@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240930170415.23841-10-ville.syrjala@linux.intel.com
1 parent d4f9a05 commit 08222ca

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

drivers/gpu/drm/i915/display/intel_dsb.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,17 @@ void intel_dsb_chain(struct intel_atomic_state *state,
637637
wait_for_vblank ? DSB_WAIT_FOR_VBLANK : 0);
638638
}
639639

640+
void intel_dsb_wait_vblank_delay(struct intel_atomic_state *state,
641+
struct intel_dsb *dsb)
642+
{
643+
struct intel_crtc *crtc = dsb->crtc;
644+
const struct intel_crtc_state *crtc_state = pre_commit_crtc_state(state, crtc);
645+
int usecs = intel_scanlines_to_usecs(&crtc_state->hw.adjusted_mode,
646+
dsb_vblank_delay(crtc_state)) + 1;
647+
648+
intel_dsb_wait_usec(dsb, usecs);
649+
}
650+
640651
static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
641652
int hw_dewake_scanline)
642653
{

drivers/gpu/drm/i915/display/intel_dsb.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ void intel_dsb_nonpost_end(struct intel_dsb *dsb);
4242
void intel_dsb_interrupt(struct intel_dsb *dsb);
4343
void intel_dsb_wait_usec(struct intel_dsb *dsb, int count);
4444
void intel_dsb_wait_vblanks(struct intel_dsb *dsb, int count);
45+
void intel_dsb_wait_vblank_delay(struct intel_atomic_state *state,
46+
struct intel_dsb *dsb);
4547
void intel_dsb_wait_scanline_in(struct intel_atomic_state *state,
4648
struct intel_dsb *dsb,
4749
int lower, int upper);

0 commit comments

Comments
 (0)