From: "Hogander, Jouni" <jouni.hogander@intel.com>
To: "intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>,
"Manna, Animesh" <animesh.manna@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Cc: "Nikula, Jani" <jani.nikula@intel.com>, "B, Jeevan" <jeevan.b@intel.com>
Subject: Re: [PATCH v9 10/10] drm/i915/display: Disintegrate sink alpm enable from psr with lobf
Date: Thu, 17 Apr 2025 13:42:23 +0000 [thread overview]
Message-ID: <9cb8a8b06472eb2126fa0ab17f2042f5274118b8.camel@intel.com> (raw)
In-Reply-To: <20250417094123.1662424-11-animesh.manna@intel.com>
On Thu, 2025-04-17 at 15:11 +0530, Animesh Manna wrote:
> Make a generic alpm enable function for sink which can be used for
> PSR2/PR/Lobf.
>
> Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_alpm.c | 27
> ++++++++++++++++++++++-
> drivers/gpu/drm/i915/display/intel_psr.c | 23 -------------------
> 2 files changed, 26 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c
> b/drivers/gpu/drm/i915/display/intel_alpm.c
> index 3d4459881e7c..f4d869953045 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -429,6 +429,29 @@ void intel_alpm_pre_plane_update(struct
> intel_atomic_state *state,
> }
> }
>
> +static void intel_alpm_enable_sink(struct intel_dp *intel_dp,
> + const struct intel_crtc_state
> *crtc_state)
> +{
> + u8 val;
> +
> + /*
> + * eDP Panel Replay uses always ALPM
> + * PSR2 uses ALPM but PSR1 doesn't
> + */
> + if (!intel_dp_is_edp(intel_dp) || (!crtc_state-
> >has_panel_replay &&
> + !crtc_state-
> >has_sel_update &&
> + !crtc_state->has_lobf))
> + return;
> +
> + val = DP_ALPM_ENABLE | DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE;
> +
> + if (crtc_state->has_panel_replay || (crtc_state->has_lobf &&
> +
> intel_alpm_aux_less_wake_supported(intel_dp)))
I know this is kind of late comment. I'm sorry for that. Instead of
spreading these ugly checks outside PSR code you could add:
intel_psr_needs_alpm(struct intel_dp *intel_dp, const struct
intel_crtc_state *crtc_state))
into intel_psr.[ch] and use it here and other relevant places in
intel_alpm.c. E.g lnl_alpm_configure:
if (DISPLAY_VER(display) < 20 || (!crtc_state->has_sel_update &&
!intel_dp_is_edp(intel_dp)))
return;
to
if (DISPLAY_VER(display) < 20 || !intel_psr_needs_alpm(intel_dp,
crtc_state)))
return;
and so on. What do you think?
BR,
Jouni Högander
> + val |= DP_ALPM_MODE_AUX_LESS;
> +
> + drm_dp_dpcd_writeb(&intel_dp->aux, DP_RECEIVER_ALPM_CONFIG,
> val);
> +}
> +
> void intel_alpm_post_plane_update(struct intel_atomic_state *state,
> struct intel_crtc *crtc)
> {
> @@ -452,8 +475,10 @@ void intel_alpm_post_plane_update(struct
> intel_atomic_state *state,
>
> intel_dp = enc_to_intel_dp(encoder);
>
> - if (intel_dp_is_edp(intel_dp))
> + if (intel_dp_is_edp(intel_dp)) {
> + intel_alpm_enable_sink(intel_dp,
> crtc_state);
> intel_alpm_configure(intel_dp, crtc_state);
> + }
> }
> }
>
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> b/drivers/gpu/drm/i915/display/intel_psr.c
> index 43ed166007eb..68952f7bdd7c 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -794,32 +794,9 @@ static void _psr_enable_sink(struct intel_dp
> *intel_dp,
> drm_dp_dpcd_writeb(&intel_dp->aux, DP_PSR_EN_CFG, val);
> }
>
> -static void intel_psr_enable_sink_alpm(struct intel_dp *intel_dp,
> - const struct intel_crtc_state
> *crtc_state)
> -{
> - u8 val;
> -
> - /*
> - * eDP Panel Replay uses always ALPM
> - * PSR2 uses ALPM but PSR1 doesn't
> - */
> - if (!intel_dp_is_edp(intel_dp) || (!crtc_state-
> >has_panel_replay &&
> - !crtc_state-
> >has_sel_update))
> - return;
> -
> - val = DP_ALPM_ENABLE | DP_ALPM_LOCK_ERROR_IRQ_HPD_ENABLE;
> -
> - if (crtc_state->has_panel_replay)
> - val |= DP_ALPM_MODE_AUX_LESS;
> -
> - drm_dp_dpcd_writeb(&intel_dp->aux, DP_RECEIVER_ALPM_CONFIG,
> val);
> -}
> -
> static void intel_psr_enable_sink(struct intel_dp *intel_dp,
> const struct intel_crtc_state
> *crtc_state)
> {
> - intel_psr_enable_sink_alpm(intel_dp, crtc_state);
> -
> crtc_state->has_panel_replay ?
> _panel_replay_enable_sink(intel_dp, crtc_state) :
> _psr_enable_sink(intel_dp, crtc_state);
next prev parent reply other threads:[~2025-04-17 13:42 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-17 9:41 [PATCH v9 00/10] LOBF enablement fix Animesh Manna
2025-04-17 9:41 ` [PATCH v9 01/10] drm/i915/alpm: use variable from intel_crtc_state instead of intel_psr Animesh Manna
2025-04-17 9:41 ` [PATCH v9 02/10] drm/i915/lobf: Add lobf enablement in post plane update Animesh Manna
2025-04-17 9:41 ` [PATCH v9 03/10] drm/i915/lobf: Add debug print for LOBF Animesh Manna
2025-04-17 9:41 ` [PATCH v9 04/10] drm/i915/lobf: Disintegrate alpm_disable from psr_disable Animesh Manna
2025-04-17 9:41 ` [PATCH v9 05/10] drm/i915/lobf: Add fixed refresh rate check in compute_config() Animesh Manna
2025-04-17 9:41 ` [PATCH v9 06/10] drm/i915/lobf: Update lobf if any change in dependent parameters Animesh Manna
2025-04-22 11:48 ` Hogander, Jouni
2025-04-22 14:16 ` Manna, Animesh
2025-04-22 14:54 ` Manna, Animesh
2025-04-17 9:41 ` [PATCH v9 07/10] drm/i915/lobf: Add debug interface for lobf Animesh Manna
2025-04-17 9:41 ` [PATCH v9 08/10] drm/i915/lobf: Add mutex for alpm update Animesh Manna
2025-04-17 9:41 ` [PATCH v9 09/10] drm/i915/lobf: Check for sink error and disable LOBF Animesh Manna
2025-04-17 9:41 ` [PATCH v9 10/10] drm/i915/display: Disintegrate sink alpm enable from psr with lobf Animesh Manna
2025-04-17 13:42 ` Hogander, Jouni [this message]
2025-04-22 8:07 ` Manna, Animesh
2025-04-22 9:14 ` Hogander, Jouni
2025-04-17 11:20 ` ✗ Fi.CI.CHECKPATCH: warning for LOBF enablement fix (rev9) Patchwork
2025-04-17 11:20 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-04-17 11:44 ` ✓ i915.CI.BAT: success " Patchwork
2025-04-17 22:42 ` ✗ i915.CI.Full: failure " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9cb8a8b06472eb2126fa0ab17f2042f5274118b8.camel@intel.com \
--to=jouni.hogander@intel.com \
--cc=animesh.manna@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=jeevan.b@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox