Skip to content

Commit 7c50c6a

Browse files
committed
drm/i915/dsb: Move the DSB_PMCTRL* reset out of intel_dsb_finish()
When using the flip queue, due to the DMC vs. DSB register corruption problem, we must not issue any register writes from the DSB after unhalting the DMC. Currently we are doing just that by trying to restore DSB_PMCTRL* back to a sane state from intel_dsb_finish(). Since the only place left that pokes at DSB_PMCTRL* is intel_dsb_chain() we can just do DSB_PMCTRL_2/DSB_FORCE_DEWAKE reset in the same place. The DSB_PMCTRL reset is trickier since we'd have to do it from the chained DSB itself. But based on my earlier testing DSB_PMCTRL/DSB_ENABLE_DEWAKE doesn't actually do anything if the DSB isn't actually enabled, so we can omit the reset to keep things a bit simpler. We do need to reset DSB_PMCTRL/DSB_ENABLE_DEWAKE before tarting the DSB however, in case it was left enabled from a previous use. 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 00863f0 commit 7c50c6a

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -628,18 +628,6 @@ void intel_dsb_gosub_finish(struct intel_dsb *dsb)
628628

629629
void intel_dsb_finish(struct intel_dsb *dsb)
630630
{
631-
struct intel_crtc *crtc = dsb->crtc;
632-
633-
/*
634-
* DSB_FORCE_DEWAKE remains active even after DSB is
635-
* disabled, so make sure to clear it (if set during
636-
* intel_dsb_commit()). And clear DSB_ENABLE_DEWAKE as
637-
* well for good measure.
638-
*/
639-
intel_dsb_reg_write(dsb, DSB_PMCTRL(crtc->pipe, dsb->id), 0);
640-
intel_dsb_reg_write_masked(dsb, DSB_PMCTRL_2(crtc->pipe, dsb->id),
641-
DSB_FORCE_DEWAKE, 0);
642-
643631
intel_dsb_align_tail(dsb);
644632

645633
intel_dsb_buffer_flush_map(&dsb->dsb_buf);
@@ -780,6 +768,8 @@ static void _intel_dsb_chain(struct intel_atomic_state *state,
780768
intel_dsb_reg_write(dsb, DSB_PMCTRL(pipe, chained_dsb->id),
781769
DSB_ENABLE_DEWAKE |
782770
DSB_SCANLINE_FOR_DEWAKE(hw_dewake_scanline));
771+
} else {
772+
intel_dsb_reg_write(dsb, DSB_PMCTRL(pipe, chained_dsb->id), 0);
783773
}
784774

785775
intel_dsb_reg_write(dsb, DSB_HEAD(pipe, chained_dsb->id),
@@ -801,6 +791,13 @@ static void _intel_dsb_chain(struct intel_atomic_state *state,
801791
intel_dsb_wait_scanline_out(state, dsb,
802792
dsb_dewake_scanline_start(state, crtc),
803793
dsb_dewake_scanline_end(state, crtc));
794+
795+
/*
796+
* DSB_FORCE_DEWAKE remains active even after DSB is
797+
* disabled, so make sure to clear it.
798+
*/
799+
intel_dsb_reg_write_masked(dsb, DSB_PMCTRL_2(crtc->pipe, dsb->id),
800+
DSB_FORCE_DEWAKE, 0);
804801
}
805802
}
806803

@@ -856,6 +853,8 @@ void intel_dsb_commit(struct intel_dsb *dsb)
856853
dsb_error_int_status(display) | DSB_PROG_INT_STATUS |
857854
dsb_error_int_en(display) | DSB_PROG_INT_EN);
858855

856+
intel_de_write_fw(display, DSB_PMCTRL(pipe, dsb->id), 0);
857+
859858
intel_de_write_fw(display, DSB_HEAD(pipe, dsb->id),
860859
intel_dsb_head(dsb));
861860

0 commit comments

Comments
 (0)