Skip to content

Commit 00863f0

Browse files
committed
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 <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent ee14e26 commit 00863f0

File tree

3 files changed

+11
-41
lines changed

3 files changed

+11
-41
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6748,13 +6748,13 @@ static void intel_update_crtc(struct intel_atomic_state *state,
67486748
if (new_crtc_state->use_dsb) {
67496749
intel_crtc_prepare_vblank_event(new_crtc_state, &crtc->dsb_event);
67506750

6751-
intel_dsb_commit(new_crtc_state->dsb_commit, false);
6751+
intel_dsb_commit(new_crtc_state->dsb_commit);
67526752
} else {
67536753
/* Perform vblank evasion around commit operation */
67546754
intel_pipe_update_start(state, crtc);
67556755

67566756
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);
67586758

67596759
commit_pipe_pre_planes(state, crtc);
67606760

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

Lines changed: 8 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -825,8 +825,13 @@ void intel_dsb_wait_vblank_delay(struct intel_atomic_state *state,
825825
intel_dsb_wait_usec(dsb, usecs);
826826
}
827827

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)
830835
{
831836
struct intel_crtc *crtc = dsb->crtc;
832837
struct intel_display *display = to_intel_display(crtc->base.dev);
@@ -842,7 +847,7 @@ static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
842847
}
843848

844849
intel_de_write_fw(display, DSB_CTRL(pipe, dsb->id),
845-
ctrl | DSB_ENABLE);
850+
DSB_ENABLE);
846851

847852
intel_de_write_fw(display, DSB_CHICKEN(pipe, dsb->id),
848853
dsb->chicken);
@@ -854,44 +859,10 @@ static void _intel_dsb_commit(struct intel_dsb *dsb, u32 ctrl,
854859
intel_de_write_fw(display, DSB_HEAD(pipe, dsb->id),
855860
intel_dsb_head(dsb));
856861

857-
if (hw_dewake_scanline >= 0) {
858-
int diff, position;
859-
860-
intel_de_write_fw(display, DSB_PMCTRL(pipe, dsb->id),
861-
DSB_ENABLE_DEWAKE |
862-
DSB_SCANLINE_FOR_DEWAKE(hw_dewake_scanline));
863-
864-
/*
865-
* Force DEwake immediately if we're already past
866-
* or close to racing past the target scanline.
867-
*/
868-
position = intel_de_read_fw(display, PIPEDSL(display, pipe)) & PIPEDSL_LINE_MASK;
869-
870-
diff = hw_dewake_scanline - position;
871-
intel_de_write_fw(display, DSB_PMCTRL_2(pipe, dsb->id),
872-
(diff >= 0 && diff < 5 ? DSB_FORCE_DEWAKE : 0) |
873-
DSB_BLOCK_DEWAKE_EXTENSION);
874-
}
875-
876862
intel_de_write_fw(display, DSB_TAIL(pipe, dsb->id),
877863
intel_dsb_tail(dsb));
878864
}
879865

880-
/**
881-
* intel_dsb_commit() - Trigger workload execution of DSB.
882-
* @dsb: DSB context
883-
* @wait_for_vblank: wait for vblank before executing
884-
*
885-
* This function is used to do actual write to hardware using DSB.
886-
*/
887-
void intel_dsb_commit(struct intel_dsb *dsb,
888-
bool wait_for_vblank)
889-
{
890-
_intel_dsb_commit(dsb,
891-
wait_for_vblank ? DSB_WAIT_FOR_VBLANK : 0,
892-
wait_for_vblank ? dsb->hw_dewake_scanline : -1);
893-
}
894-
895866
void intel_dsb_wait(struct intel_dsb *dsb)
896867
{
897868
struct intel_crtc *crtc = dsb->crtc;

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ void intel_dsb_chain(struct intel_atomic_state *state,
6868
struct intel_dsb *chained_dsb,
6969
bool wait_for_vblank);
7070

71-
void intel_dsb_commit(struct intel_dsb *dsb,
72-
bool wait_for_vblank);
71+
void intel_dsb_commit(struct intel_dsb *dsb);
7372
void intel_dsb_wait(struct intel_dsb *dsb);
7473

7574
void intel_dsb_irq_handler(struct intel_display *display,

0 commit comments

Comments
 (0)