Skip to content

Commit eff82fb

Browse files
hoganderjlahtine-intel
authored andcommitted
drm/i915/alpm: Stop writing ALPM registers when PSR is enabled
Currently we are seeing these on PTL: xe 0000:00:02.0: [drm] *ERROR* Timeout waiting for DDI BUF A to get active These seem to be caused by writing ALPM registers while Panel Replay is enabled. Fix this by writing ALPM registers only when Panel Replay is about to be enabled. v4: improve comment on intel_psr_panel_replay_enable_sink call v3: enable/disable ALPM from PSR code Fixes: 172757a ("drm/i915/lobf: Add lobf enablement in post plane update") Signed-off-by: Jouni Högander <[email protected]> Reviewed-by: Suraj Kandpal <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit a8eb102) Signed-off-by: Joonas Lahtinen <[email protected]>
1 parent 411c869 commit eff82fb

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,8 @@ void intel_alpm_post_plane_update(struct intel_atomic_state *state,
453453
intel_atomic_get_old_crtc_state(state, crtc);
454454
struct intel_encoder *encoder;
455455

456-
if ((!crtc_state->has_lobf ||
457-
crtc_state->has_lobf == old_crtc_state->has_lobf) && !crtc_state->has_psr)
456+
if (crtc_state->has_psr || !crtc_state->has_lobf ||
457+
crtc_state->has_lobf == old_crtc_state->has_lobf)
458458
return;
459459

460460
for_each_intel_encoder_mask(display->drm, encoder,

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

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,8 @@ static void _psr_enable_sink(struct intel_dp *intel_dp,
800800
static void intel_psr_enable_sink(struct intel_dp *intel_dp,
801801
const struct intel_crtc_state *crtc_state)
802802
{
803+
intel_alpm_enable_sink(intel_dp, crtc_state);
804+
803805
crtc_state->has_panel_replay ?
804806
_panel_replay_enable_sink(intel_dp, crtc_state) :
805807
_psr_enable_sink(intel_dp, crtc_state);
@@ -1962,6 +1964,8 @@ static void intel_psr_enable_source(struct intel_dp *intel_dp,
19621964
IS_DISPLAY_VERx100_STEP(display, 3000, STEP_A0, STEP_B0)) &&
19631965
!intel_dp->psr.panel_replay_enabled)
19641966
intel_dmc_block_pkgc(display, intel_dp->psr.pipe, true);
1967+
1968+
intel_alpm_configure(intel_dp, crtc_state);
19651969
}
19661970

19671971
static bool psr_interrupt_error_check(struct intel_dp *intel_dp)
@@ -2029,8 +2033,9 @@ static void intel_psr_enable_locked(struct intel_dp *intel_dp,
20292033
intel_dp->psr.sel_update_enabled ? "2" : "1");
20302034

20312035
/*
2032-
* Enabling here only for PSR. Panel Replay enable bit is already
2033-
* written at this point. See
2036+
* Enabling sink PSR/Panel Replay here only for PSR. Panel Replay enable
2037+
* bit is already written at this point. Sink ALPM is enabled here for
2038+
* PSR and Panel Replay. See
20342039
* intel_psr_panel_replay_enable_sink. Modifiers/options:
20352040
* - Selective Update
20362041
* - Region Early Transport
@@ -2172,6 +2177,9 @@ static void intel_psr_disable_locked(struct intel_dp *intel_dp)
21722177
if (intel_dp_is_edp(intel_dp))
21732178
intel_snps_phy_update_psr_power_state(&dp_to_dig_port(intel_dp)->base, false);
21742179

2180+
if (intel_dp->psr.panel_replay_enabled && intel_dp_is_edp(intel_dp))
2181+
intel_alpm_disable(intel_dp);
2182+
21752183
/* Disable PSR on Sink */
21762184
if (!intel_dp->psr.panel_replay_enabled) {
21772185
drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, 0);
@@ -3498,7 +3506,6 @@ static void psr_alpm_check(struct intel_dp *intel_dp)
34983506
if (intel_alpm_get_error(intel_dp)) {
34993507
intel_psr_disable_locked(intel_dp);
35003508
psr->sink_not_reliable = true;
3501-
intel_alpm_disable(intel_dp);
35023509
}
35033510
}
35043511

0 commit comments

Comments
 (0)