Skip to content

Commit a18114e

Browse files
committed
drm/i915/psr: Perform psr2 checks related to ALPM for Panel Replay
eDP1.5 support ALPM with Panel Replay as well. We need to check ALPM related things for Panel Replay as well. Bspec: 68920 v5: - instead of using crtc_state->has_panel_replay provide aux_less flag v4: - do not move _compute_psr2_sdp_prior_scanline_indication - move ALPM related checks to separate function v3: move vblank check as well v2: do not move Vblank >= PSR2_CTL Block Count Number maximum line count check Signed-off-by: Jouni Högander <[email protected]> Reviewed-by: Animesh Manna <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 5d81c29 commit a18114e

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

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

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,14 +1306,15 @@ static int intel_psr_entry_setup_frames(struct intel_dp *intel_dp,
13061306
}
13071307

13081308
static bool wake_lines_fit_into_vblank(struct intel_dp *intel_dp,
1309-
const struct intel_crtc_state *crtc_state)
1309+
const struct intel_crtc_state *crtc_state,
1310+
bool aux_less)
13101311
{
13111312
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
13121313
int vblank = crtc_state->hw.adjusted_mode.crtc_vblank_end -
13131314
crtc_state->hw.adjusted_mode.crtc_vblank_start;
13141315
int wake_lines;
13151316

1316-
if (crtc_state->has_panel_replay)
1317+
if (aux_less)
13171318
wake_lines = intel_dp->alpm_parameters.aux_less_wake_lines;
13181319
else
13191320
wake_lines = DISPLAY_VER(i915) < 20 ?
@@ -1330,6 +1331,27 @@ static bool wake_lines_fit_into_vblank(struct intel_dp *intel_dp,
13301331
return true;
13311332
}
13321333

1334+
static bool alpm_config_valid(struct intel_dp *intel_dp,
1335+
const struct intel_crtc_state *crtc_state,
1336+
bool aux_less)
1337+
{
1338+
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
1339+
1340+
if (!intel_alpm_compute_params(intel_dp, crtc_state)) {
1341+
drm_dbg_kms(&i915->drm,
1342+
"PSR2/Panel Replay not enabled, Unable to use long enough wake times\n");
1343+
return false;
1344+
}
1345+
1346+
if (!wake_lines_fit_into_vblank(intel_dp, crtc_state, aux_less)) {
1347+
drm_dbg_kms(&i915->drm,
1348+
"PSR2/Panel Replay not enabled, too short vblank time\n");
1349+
return false;
1350+
}
1351+
1352+
return true;
1353+
}
1354+
13331355
static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
13341356
struct intel_crtc_state *crtc_state)
13351357
{
@@ -1413,18 +1435,8 @@ static bool intel_psr2_config_valid(struct intel_dp *intel_dp,
14131435
return false;
14141436
}
14151437

1416-
if (!intel_alpm_compute_params(intel_dp, crtc_state)) {
1417-
drm_dbg_kms(&dev_priv->drm,
1418-
"PSR2 not enabled, Unable to use long enough wake times\n");
1438+
if (!alpm_config_valid(intel_dp, crtc_state, false))
14191439
return false;
1420-
}
1421-
1422-
/* Vblank >= PSR2_CTL Block Count Number maximum line count */
1423-
if (!wake_lines_fit_into_vblank(intel_dp, crtc_state)) {
1424-
drm_dbg_kms(&dev_priv->drm,
1425-
"PSR2 not enabled, too short vblank time\n");
1426-
return false;
1427-
}
14281440

14291441
if (!crtc_state->enable_psr2_sel_fetch &&
14301442
(crtc_hdisplay > psr_max_h || crtc_vdisplay > psr_max_v)) {
@@ -1558,6 +1570,9 @@ _panel_replay_compute_config(struct intel_dp *intel_dp,
15581570
return false;
15591571
}
15601572

1573+
if (!alpm_config_valid(intel_dp, crtc_state, true))
1574+
return false;
1575+
15611576
return true;
15621577
}
15631578

0 commit comments

Comments
 (0)