Skip to content

Commit ee14e26

Browse files
committed
drm/i915/dsb: Introduce intel_dsb_exec_time_us()
Pull the magic 20 usec DSB execution deadline into intel_dsb_arm_exec_time_us(), and also add its counterpart for the non-arming register write section. For the non-arming part we'll just throw in a random 80 usec for now so the total is 100usec. The total exec time will be needed by the upcoming flip queue code. Reviewed-by: Uma Shankar <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 7e151f5 commit ee14e26

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

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

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -685,14 +685,36 @@ static u32 dsb_error_int_en(struct intel_display *display)
685685
return errors;
686686
}
687687

688+
/*
689+
* FIXME calibrate these sensibly, ideally compute based on
690+
* the number of regisetrs to be written. But that requires
691+
* measuring the actual DSB execution speed on each platform
692+
* (and the speed also depends on CDCLK and memory clock)...
693+
*/
694+
static int intel_dsb_noarm_exec_time_us(void)
695+
{
696+
return 80;
697+
}
698+
699+
static int intel_dsb_arm_exec_time_us(void)
700+
{
701+
return 20;
702+
}
703+
704+
int intel_dsb_exec_time_us(void)
705+
{
706+
return intel_dsb_noarm_exec_time_us() +
707+
intel_dsb_arm_exec_time_us();
708+
}
709+
688710
void intel_dsb_vblank_evade(struct intel_atomic_state *state,
689711
struct intel_dsb *dsb)
690712
{
691713
struct intel_crtc *crtc = dsb->crtc;
692714
const struct intel_crtc_state *crtc_state =
693715
intel_pre_commit_crtc_state(state, crtc);
694-
/* FIXME calibrate sensibly */
695-
int latency = intel_usecs_to_scanlines(&crtc_state->hw.adjusted_mode, 20);
716+
int latency = intel_usecs_to_scanlines(&crtc_state->hw.adjusted_mode,
717+
intel_dsb_arm_exec_time_us());
696718
int start, end;
697719

698720
/*

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ struct intel_dsb *intel_dsb_prepare(struct intel_atomic_state *state,
3535
void intel_dsb_finish(struct intel_dsb *dsb);
3636
void intel_dsb_gosub_finish(struct intel_dsb *dsb);
3737
void intel_dsb_cleanup(struct intel_dsb *dsb);
38+
int intel_dsb_exec_time_us(void);
3839
void intel_dsb_reg_write(struct intel_dsb *dsb,
3940
i915_reg_t reg, u32 val);
4041
void intel_dsb_reg_write_indexed(struct intel_dsb *dsb,

0 commit comments

Comments
 (0)