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

drm/i915/dsb: Garbage collect the MMIO DEwake stuff

Since the introduction of DSB chaining we no longer need the
DEwake tricks in intel_dsb_commit().

I also need to relocate the DSB_PMCTRL* writes out of
intel_dsb_finish() (due to the flip queue DMC vs. DSB register
corruption issues), and it'll be a bit more straightforward if
I don't have to worry about the non-chained DSB path anymore.

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-5-ville.syrjala@linux.intel.com

+11 -41
+2 -2
drivers/gpu/drm/i915/display/intel_display.c
··· 6748 6748 if (new_crtc_state->use_dsb) { 6749 6749 intel_crtc_prepare_vblank_event(new_crtc_state, &crtc->dsb_event); 6750 6750 6751 - intel_dsb_commit(new_crtc_state->dsb_commit, false); 6751 + intel_dsb_commit(new_crtc_state->dsb_commit); 6752 6752 } else { 6753 6753 /* Perform vblank evasion around commit operation */ 6754 6754 intel_pipe_update_start(state, crtc); 6755 6755 6756 6756 if (new_crtc_state->dsb_commit) 6757 - intel_dsb_commit(new_crtc_state->dsb_commit, false); 6757 + intel_dsb_commit(new_crtc_state->dsb_commit); 6758 6758 6759 6759 commit_pipe_pre_planes(state, crtc); 6760 6760
+8 -37
drivers/gpu/drm/i915/display/intel_dsb.c
··· 825 825 intel_dsb_wait_usec(dsb, usecs); 826 826 } 827 827 828 - static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl, 829 - int hw_dewake_scanline) 828 + /** 829 + * intel_dsb_commit() - Trigger workload execution of DSB. 830 + * @dsb: DSB context 831 + * 832 + * This function is used to do actual write to hardware using DSB. 833 + */ 834 + void intel_dsb_commit(struct intel_dsb *dsb) 830 835 { 831 836 struct intel_crtc *crtc = dsb->crtc; 832 837 struct intel_display *display = to_intel_display(crtc->base.dev); ··· 847 842 } 848 843 849 844 intel_de_write_fw(display, DSB_CTRL(pipe, dsb->id), 850 - ctrl | DSB_ENABLE); 845 + DSB_ENABLE); 851 846 852 847 intel_de_write_fw(display, DSB_CHICKEN(pipe, dsb->id), 853 848 dsb->chicken); ··· 859 854 intel_de_write_fw(display, DSB_HEAD(pipe, dsb->id), 860 855 intel_dsb_head(dsb)); 861 856 862 - if (hw_dewake_scanline >= 0) { 863 - int diff, position; 864 - 865 - intel_de_write_fw(display, DSB_PMCTRL(pipe, dsb->id), 866 - DSB_ENABLE_DEWAKE | 867 - DSB_SCANLINE_FOR_DEWAKE(hw_dewake_scanline)); 868 - 869 - /* 870 - * Force DEwake immediately if we're already past 871 - * or close to racing past the target scanline. 872 - */ 873 - position = intel_de_read_fw(display, PIPEDSL(display, pipe)) & PIPEDSL_LINE_MASK; 874 - 875 - diff = hw_dewake_scanline - position; 876 - intel_de_write_fw(display, DSB_PMCTRL_2(pipe, dsb->id), 877 - (diff >= 0 && diff < 5 ? DSB_FORCE_DEWAKE : 0) | 878 - DSB_BLOCK_DEWAKE_EXTENSION); 879 - } 880 - 881 857 intel_de_write_fw(display, DSB_TAIL(pipe, dsb->id), 882 858 intel_dsb_tail(dsb)); 883 - } 884 - 885 - /** 886 - * intel_dsb_commit() - Trigger workload execution of DSB. 887 - * @dsb: DSB context 888 - * @wait_for_vblank: wait for vblank before executing 889 - * 890 - * This function is used to do actual write to hardware using DSB. 891 - */ 892 - void intel_dsb_commit(struct intel_dsb *dsb, 893 - bool wait_for_vblank) 894 - { 895 - _intel_dsb_commit(dsb, 896 - wait_for_vblank ? DSB_WAIT_FOR_VBLANK : 0, 897 - wait_for_vblank ? dsb->hw_dewake_scanline : -1); 898 859 } 899 860 900 861 void intel_dsb_wait(struct intel_dsb *dsb)
+1 -2
drivers/gpu/drm/i915/display/intel_dsb.h
··· 68 68 struct intel_dsb *chained_dsb, 69 69 bool wait_for_vblank); 70 70 71 - void intel_dsb_commit(struct intel_dsb *dsb, 72 - bool wait_for_vblank); 71 + void intel_dsb_commit(struct intel_dsb *dsb); 73 72 void intel_dsb_wait(struct intel_dsb *dsb); 74 73 75 74 void intel_dsb_irq_handler(struct intel_display *display,