All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: "Jouni Högander" <jouni.hogander@intel.com>,
	intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: "Jouni Högander" <jouni.hogander@intel.com>
Subject: Re: [PATCH v2 1/2] drm/i915/psr: Check drm_dp_dpcd_read return value on PSR dpcd init
Date: Thu, 21 Aug 2025 10:42:12 +0300	[thread overview]
Message-ID: <53e3d526cd41f74c906377cf8fb9add6d7dd441b@intel.com> (raw)
In-Reply-To: <20250821045918.17757-1-jouni.hogander@intel.com>

On Thu, 21 Aug 2025, Jouni Högander <jouni.hogander@intel.com> wrote:
> 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@intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.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 609df53f1ef1..5addde63168e 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -580,6 +580,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)) {
> @@ -611,6 +621,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]);
> @@ -656,18 +675,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)

-- 
Jani Nikula, Intel

  parent reply	other threads:[~2025-08-21  7:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-21  4:59 [PATCH v2 1/2] drm/i915/psr: Check drm_dp_dpcd_read return value on PSR dpcd init Jouni Högander
2025-08-21  4:59 ` [PATCH v2 2/2] drm/i915/psr: check drm_mode_vrefresh return value Jouni Högander
2025-08-21  7:42   ` Jani Nikula
2025-08-21 13:10   ` Ville Syrjälä
2025-08-22  5:07     ` Hogander, Jouni
2025-08-22 14:12       ` Ville Syrjälä
2025-08-22 14:51         ` Hogander, Jouni
2025-08-21  5:49 ` ✓ CI.KUnit: success for series starting with [v2,1/2] drm/i915/psr: Check drm_dp_dpcd_read return value on PSR dpcd init Patchwork
2025-08-21  6:50 ` ✓ Xe.CI.BAT: " Patchwork
2025-08-21  7:42 ` Jani Nikula [this message]
2025-08-25  6:22   ` [PATCH v2 1/2] " Hogander, Jouni
2025-08-21  9:40 ` ✓ i915.CI.BAT: success for series starting with [v2,1/2] " Patchwork
2025-08-21 12:43 ` ✓ i915.CI.Full: " Patchwork
2025-08-22  0:36 ` ✗ Xe.CI.Full: failure " Patchwork
2025-08-25  6:11   ` Hogander, Jouni
2025-08-25  7:10     ` Saarinen, Jani

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=53e3d526cd41f74c906377cf8fb9add6d7dd441b@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jouni.hogander@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.