Skip to content

Commit a47828f

Browse files
committed
drm/i915/flipq: Implement Wa_18034343758
Implement the driver side of Wa_18034343758, which is supposed to prevent the DSB and DMC from accessing registers in parallel, and thus potentially corrupting the registers due to a hardware issue (which should be fixed in PTL-B0). The w/a sequence goes as follows: DMC starts the DSB | \ DMC halts itself | DSB waits a while for DMC to have time to halt . | DSB executes normally . | DSB unhalts the DMC at the very end . / DMC resumes execution v2: PTL-B0+ firmware no longer has the w/a since the hw got fixed v3: Do the w/a on all PTL for now since we only have the A0 firmware binaries which issues the halt instructions unconditionally v4: PTL DMC binaries do in fact have the A0 vs. B0 split, so skip the w/a on PTL-B0+ 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 ec3a347 commit a47828f

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7246,6 +7246,10 @@ static void intel_atomic_dsb_finish(struct intel_atomic_state *state,
72467246
}
72477247

72487248
if (new_crtc_state->use_flipq || new_crtc_state->use_dsb) {
7249+
/* Wa_18034343758 */
7250+
if (new_crtc_state->use_flipq)
7251+
intel_flipq_wait_dmc_halt(new_crtc_state->dsb_commit, crtc);
7252+
72497253
if (intel_crtc_needs_color_update(new_crtc_state))
72507254
intel_color_commit_noarm(new_crtc_state->dsb_commit,
72517255
new_crtc_state);
@@ -7276,6 +7280,10 @@ static void intel_atomic_dsb_finish(struct intel_atomic_state *state,
72767280
if (DISPLAY_VER(display) >= 9)
72777281
skl_detach_scalers(new_crtc_state->dsb_commit,
72787282
new_crtc_state);
7283+
7284+
/* Wa_18034343758 */
7285+
if (new_crtc_state->use_flipq)
7286+
intel_flipq_unhalt_dmc(new_crtc_state->dsb_commit, crtc);
72797287
}
72807288

72817289
if (intel_color_uses_chained_dsb(new_crtc_state))

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,3 +400,27 @@ void intel_flipq_add(struct intel_crtc *crtc,
400400

401401
intel_flipq_sw_dmc_wake(crtc);
402402
}
403+
404+
/* Wa_18034343758 */
405+
static bool need_dmc_halt_wa(struct intel_display *display)
406+
{
407+
return DISPLAY_VER(display) == 20 ||
408+
(display->platform.pantherlake &&
409+
IS_DISPLAY_STEP(display, STEP_A0, STEP_B0));
410+
}
411+
412+
void intel_flipq_wait_dmc_halt(struct intel_dsb *dsb, struct intel_crtc *crtc)
413+
{
414+
struct intel_display *display = to_intel_display(crtc);
415+
416+
if (need_dmc_halt_wa(display))
417+
intel_dsb_wait_usec(dsb, 2);
418+
}
419+
420+
void intel_flipq_unhalt_dmc(struct intel_dsb *dsb, struct intel_crtc *crtc)
421+
{
422+
struct intel_display *display = to_intel_display(crtc);
423+
424+
if (need_dmc_halt_wa(display))
425+
intel_dsb_reg_write(dsb, PIPEDMC_CTL(crtc->pipe), 0);
426+
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@ void intel_flipq_add(struct intel_crtc *crtc,
2929
enum intel_dsb_id dsb_id,
3030
struct intel_dsb *dsb);
3131
int intel_flipq_exec_time_us(struct intel_display *display);
32+
void intel_flipq_wait_dmc_halt(struct intel_dsb *dsb, struct intel_crtc *crtc);
33+
void intel_flipq_unhalt_dmc(struct intel_dsb *dsb, struct intel_crtc *crtc);
3234

3335
#endif /* __INTEL_FLIPQ_H__ */

0 commit comments

Comments
 (0)