NACK: [[SRU][Q]PATCH 1/2] drm/i915/psr: Check drm_dp_dpcd_read return value on PSR dpcd init
Aaron Ma
aaron.ma at canonical.com
Fri Dec 26 07:24:33 UTC 2025
Typo in subject, please fix it.
Aaron
On Fri, Dec 26, 2025 at 2:27 PM AceLan Kao <acelan.kao at canonical.com> wrote:
>
> From: Jouni Högander <jouni.hogander at intel.com>
>
> BugLink: https://bugs.launchpad.net/bugs/2136979
>
> Currently we are ignoriong drm_dp_dpcd_read return values when reading PSR
> and Panel Replay capability DPCD register. Rework intel_psr_dpcd a bit to
> take care of checking the return value.
>
> v2: use drm_dp_dpcd_read_data
>
> Signed-off-by: Jouni Högander <jouni.hogander at intel.com>
> Reviewed-by: Jani Nikula <jani.nikula at intel.com>
> Link: https://lore.kernel.org/r/20250821045918.17757-1-jouni.hogander@intel.com
> (cherry picked from commit 9cc10041e9fe7f32c4817e3cdd806ff1986d266c)
> Signed-off-by: Chia-Lin Kao (AceLan) <acelan.kao at canonical.com>
> ---
> drivers/gpu/drm/i915/display/intel_psr.c | 32 ++++++++++++++++--------
> 1 file changed, 21 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
> index 85e9aad7ec507..ba80f8b36cd78 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -600,6 +600,16 @@ static void intel_dp_get_su_granularity(struct intel_dp *intel_dp)
> static void _panel_replay_init_dpcd(struct intel_dp *intel_dp)
> {
> struct intel_display *display = to_intel_display(intel_dp);
> + int ret;
> +
> + ret = drm_dp_dpcd_read_data(&intel_dp->aux, DP_PANEL_REPLAY_CAP_SUPPORT,
> + &intel_dp->pr_dpcd, sizeof(intel_dp->pr_dpcd));
> + if (ret < 0)
> + return;
> +
> + if (!(intel_dp->pr_dpcd[INTEL_PR_DPCD_INDEX(DP_PANEL_REPLAY_CAP_SUPPORT)] &
> + DP_PANEL_REPLAY_SUPPORT))
> + return;
>
> if (intel_dp_is_edp(intel_dp)) {
> if (!intel_alpm_aux_less_wake_supported(intel_dp)) {
> @@ -631,6 +641,15 @@ static void _panel_replay_init_dpcd(struct intel_dp *intel_dp)
> static void _psr_init_dpcd(struct intel_dp *intel_dp)
> {
> struct intel_display *display = to_intel_display(intel_dp);
> + int ret;
> +
> + ret = drm_dp_dpcd_read_data(&intel_dp->aux, DP_PSR_SUPPORT, intel_dp->psr_dpcd,
> + sizeof(intel_dp->psr_dpcd));
> + if (ret < 0)
> + return;
> +
> + if (!intel_dp->psr_dpcd[0])
> + return;
>
> drm_dbg_kms(display->drm, "eDP panel supports PSR version %x\n",
> intel_dp->psr_dpcd[0]);
> @@ -676,18 +695,9 @@ static void _psr_init_dpcd(struct intel_dp *intel_dp)
>
> void intel_psr_init_dpcd(struct intel_dp *intel_dp)
> {
> - drm_dp_dpcd_read(&intel_dp->aux, DP_PSR_SUPPORT, intel_dp->psr_dpcd,
> - sizeof(intel_dp->psr_dpcd));
> -
> - drm_dp_dpcd_read(&intel_dp->aux, DP_PANEL_REPLAY_CAP_SUPPORT,
> - &intel_dp->pr_dpcd, sizeof(intel_dp->pr_dpcd));
> -
> - if (intel_dp->pr_dpcd[INTEL_PR_DPCD_INDEX(DP_PANEL_REPLAY_CAP_SUPPORT)] &
> - DP_PANEL_REPLAY_SUPPORT)
> - _panel_replay_init_dpcd(intel_dp);
> + _psr_init_dpcd(intel_dp);
>
> - if (intel_dp->psr_dpcd[0])
> - _psr_init_dpcd(intel_dp);
> + _panel_replay_init_dpcd(intel_dp);
>
> if (intel_dp->psr.sink_psr2_support ||
> intel_dp->psr.sink_panel_replay_su_support)
> --
> 2.43.0
>
>
> --
> kernel-team mailing list
> kernel-team at lists.ubuntu.com
> https://lists.ubuntu.com/mailman/listinfo/kernel-team
More information about the kernel-team
mailing list