Skip to content

Commit 29f3067

Browse files
committed
drm/i915/alpm: Calculate ALPM Entry check
ALPM Entry Check represents the number of lines needed to put the main link to sleep and keep it in the sleep state before it can be taken out of the SLEEP state (eDP requires the main link to be in the SLEEP state for a minimum of 5us). Bspec: 71477 v2: move display version check into _lnl_compute_alpm_param Signed-off-by: Jouni Högander <jouni.hogander@intel.com> Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240130111130.3298779-4-jouni.hogander@intel.com
1 parent 96a2494 commit 29f3067

2 files changed

Lines changed: 32 additions & 0 deletions

File tree

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,6 +1716,9 @@ struct intel_psr {
17161716
struct {
17171717
u8 io_wake_lines;
17181718
u8 fast_wake_lines;
1719+
1720+
/* LNL and beyond */
1721+
u8 check_entry_lines;
17191722
} alpm_parameters;
17201723

17211724
ktime_t last_entry_attempt;

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1126,6 +1126,30 @@ static bool _compute_psr2_sdp_prior_scanline_indication(struct intel_dp *intel_d
11261126
return true;
11271127
}
11281128

1129+
static bool _lnl_compute_alpm_params(struct intel_dp *intel_dp,
1130+
struct intel_crtc_state *crtc_state)
1131+
{
1132+
struct drm_i915_private *i915 = dp_to_i915(intel_dp);
1133+
int check_entry_lines;
1134+
1135+
if (DISPLAY_VER(i915) < 20)
1136+
return true;
1137+
1138+
/* ALPM Entry Check = 2 + CEILING( 5us /tline ) */
1139+
check_entry_lines = 2 +
1140+
intel_usecs_to_scanlines(&crtc_state->hw.adjusted_mode, 5);
1141+
1142+
if (check_entry_lines > 15)
1143+
return false;
1144+
1145+
if (i915->display.params.psr_safest_params)
1146+
check_entry_lines = 15;
1147+
1148+
intel_dp->psr.alpm_parameters.check_entry_lines = check_entry_lines;
1149+
1150+
return true;
1151+
}
1152+
11291153
static bool _compute_alpm_params(struct intel_dp *intel_dp,
11301154
struct intel_crtc_state *crtc_state)
11311155
{
@@ -1140,6 +1164,8 @@ static bool _compute_alpm_params(struct intel_dp *intel_dp,
11401164
* it is not enough -> use 45 us.
11411165
*/
11421166
fast_wake_time = 45;
1167+
1168+
/* TODO: Check how we can use ALPM_CTL fast wake extended field */
11431169
max_wake_lines = 12;
11441170
} else {
11451171
io_wake_time = 50;
@@ -1156,6 +1182,9 @@ static bool _compute_alpm_params(struct intel_dp *intel_dp,
11561182
fast_wake_lines > max_wake_lines)
11571183
return false;
11581184

1185+
if (!_lnl_compute_alpm_params(intel_dp, crtc_state))
1186+
return false;
1187+
11591188
if (i915->display.params.psr_safest_params)
11601189
io_wake_lines = fast_wake_lines = max_wake_lines;
11611190

0 commit comments

Comments
 (0)