Skip to content

Commit 67cf054

Browse files
committed
drm/i915/psr: enable sink for eDP1.5 Panel Replay
eDP1.5 allows Panel Replay on eDP as well. Take this into account when enabling sink PSR/Panel Replay. Write also PANEL_REPLAY_CONFIG2 register accordingly. v3: - set DP_PANEL_REPLAY_CRC_VERIFICATION in PANEL_REPLAY_CONFIG2 - PANEL_REPLAY_CONFIG2 is available in DP2.1 as well v2: do not configure ALPM for DP2.0 Panel Replay 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 dfeb3a2 commit 67cf054

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

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

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -713,14 +713,22 @@ static void _panel_replay_enable_sink(struct intel_dp *intel_dp,
713713
DP_PANEL_REPLAY_UNRECOVERABLE_ERROR_EN |
714714
DP_PANEL_REPLAY_RFB_STORAGE_ERROR_EN |
715715
DP_PANEL_REPLAY_ACTIVE_FRAME_CRC_ERROR_EN;
716+
u8 panel_replay_config2 = DP_PANEL_REPLAY_CRC_VERIFICATION;
716717

717718
if (crtc_state->has_sel_update)
718719
val |= DP_PANEL_REPLAY_SU_ENABLE;
719720

720721
if (crtc_state->enable_psr2_su_region_et)
721722
val |= DP_PANEL_REPLAY_ENABLE_SU_REGION_ET;
722723

724+
if (crtc_state->req_psr2_sdp_prior_scanline)
725+
panel_replay_config2 |=
726+
DP_PANEL_REPLAY_SU_REGION_SCANLINE_CAPTURE;
727+
723728
drm_dp_dpcd_writeb(&intel_dp->aux, PANEL_REPLAY_CONFIG, val);
729+
730+
drm_dp_dpcd_writeb(&intel_dp->aux, PANEL_REPLAY_CONFIG2,
731+
panel_replay_config2);
724732
}
725733

726734
static void _psr_enable_sink(struct intel_dp *intel_dp,
@@ -751,15 +759,31 @@ static void _psr_enable_sink(struct intel_dp *intel_dp,
751759
drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, val);
752760
}
753761

762+
static void intel_psr_enable_sink_alpm(struct intel_dp *intel_dp,
763+
const struct intel_crtc_state *crtc_state)
764+
{
765+
u8 val;
766+
767+
/*
768+
* eDP Panel Replay uses always ALPM
769+
* PSR2 uses ALPM but PSR1 doesn't
770+
*/
771+
if (!intel_dp_is_edp(intel_dp) || (!crtc_state->has_panel_replay &&
772+
!crtc_state->has_sel_update))
773+
return;
774+
775+
val = DP_ALPM_ENABLE | DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE;
776+
777+
if (crtc_state->has_panel_replay)
778+
val |= DP_ALPM_MODE_AUX_LESS;
779+
780+
drm_dp_dpcd_writeb(&intel_dp->aux, DP_RECEIVER_ALPM_CONFIG, val);
781+
}
782+
754783
void intel_psr_enable_sink(struct intel_dp *intel_dp,
755784
const struct intel_crtc_state *crtc_state)
756785
{
757-
/* Enable ALPM at sink for psr2 */
758-
if (!crtc_state->has_panel_replay && crtc_state->has_sel_update)
759-
drm_dp_dpcd_writeb(&intel_dp->aux,
760-
DP_RECEIVER_ALPM_CONFIG,
761-
DP_ALPM_ENABLE |
762-
DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE);
786+
intel_psr_enable_sink_alpm(intel_dp, crtc_state);
763787

764788
crtc_state->has_panel_replay ?
765789
_panel_replay_enable_sink(intel_dp, crtc_state) :

0 commit comments

Comments
 (0)