Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <uma.shankar@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20250612145018.8735-4-ville.syrjala@linux.intel.com

+25 -2
+24 -2
drivers/gpu/drm/i915/display/intel_dsb.c
··· 685 685 return errors; 686 686 } 687 687 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 + 688 710 void intel_dsb_vblank_evade(struct intel_atomic_state *state, 689 711 struct intel_dsb *dsb) 690 712 { 691 713 struct intel_crtc *crtc = dsb->crtc; 692 714 const struct intel_crtc_state *crtc_state = 693 715 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()); 696 718 int start, end; 697 719 698 720 /*
+1
drivers/gpu/drm/i915/display/intel_dsb.h
··· 35 35 void intel_dsb_finish(struct intel_dsb *dsb); 36 36 void intel_dsb_gosub_finish(struct intel_dsb *dsb); 37 37 void intel_dsb_cleanup(struct intel_dsb *dsb); 38 + int intel_dsb_exec_time_us(void); 38 39 void intel_dsb_reg_write(struct intel_dsb *dsb, 39 40 i915_reg_t reg, u32 val); 40 41 void intel_dsb_reg_write_indexed(struct intel_dsb *dsb,