Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Hogander, Jouni" <jouni.hogander@intel.com>
To: "intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"Souza, Jose" <jose.souza@intel.com>
Subject: Re: [Intel-gfx] [PATCH 1/2] drm/i915/display/psr: Unset enable_psr2_sel_fetch if other checks in intel_psr2_config_valid() fails
Date: Wed, 13 Apr 2022 07:29:15 +0000	[thread overview]
Message-ID: <f4575ddb442310862ac1cba5b9a24999dc11ef1d.camel@intel.com> (raw)
In-Reply-To: <20220412205527.174685-1-jose.souza@intel.com>

On Tue, 2022-04-12 at 13:55 -0700, José Roberto de Souza wrote:
> If any of the PSR2 checks after intel_psr2_sel_fetch_config_valid()
> fails, enable_psr2_sel_fetch will be kept enabled causing problems
> in the functions that only checks for it and not for has_psr2.
> 
> So here moving the check that do not depend on enable_psr2_sel_fetch
> and for the remaning ones jumping to a section that unset
> enable_psr2_sel_fetch in case of failure to support PSR2.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>

> 
> Fixes: 6e43e276b8c9 ("drm/i915: Initial implementation of PSR2
> selective fetch")
> Cc: Jouni Högander <jouni.hogander@intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_psr.c | 38 +++++++++++++---------
> --
>  1 file changed, 21 insertions(+), 17 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> b/drivers/gpu/drm/i915/display/intel_psr.c
> index 5a55010a9b2f7..8ec7c161284be 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -891,6 +891,20 @@ static bool intel_psr2_config_valid(struct
> intel_dp *intel_dp,
>  		return false;
>  	}
>  
> +	/* Wa_16011303918:adl-p */
> +	if (crtc_state->vrr.enable &&
> +	    IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) {
> +		drm_dbg_kms(&dev_priv->drm,
> +			    "PSR2 not enabled, not compatible with HW
> stepping + VRR\n");
> +		return false;
> +	}
> +
> +	if (!_compute_psr2_sdp_prior_scanline_indication(intel_dp,
> crtc_state)) {
> +		drm_dbg_kms(&dev_priv->drm,
> +			    "PSR2 not enabled, PSR2 SDP indication do
> not fit in hblank\n");
> +		return false;
> +	}
> +
>  	if (HAS_PSR2_SEL_FETCH(dev_priv)) {
>  		if (!intel_psr2_sel_fetch_config_valid(intel_dp,
> crtc_state) &&
>  		    !HAS_PSR_HW_TRACKING(dev_priv)) {
> @@ -904,12 +918,12 @@ static bool intel_psr2_config_valid(struct
> intel_dp *intel_dp,
>  	if (!crtc_state->enable_psr2_sel_fetch &&
>  	    IS_TGL_DISPLAY_STEP(dev_priv, STEP_A0, STEP_C0)) {
>  		drm_dbg_kms(&dev_priv->drm, "PSR2 HW tracking is not
> supported this Display stepping\n");
> -		return false;
> +		goto unsupported;
>  	}
>  
>  	if (!psr2_granularity_check(intel_dp, crtc_state)) {
>  		drm_dbg_kms(&dev_priv->drm, "PSR2 not enabled, SU
> granularity not compatible\n");
> -		return false;
> +		goto unsupported;
>  	}
>  
>  	if (!crtc_state->enable_psr2_sel_fetch &&
> @@ -918,25 +932,15 @@ static bool intel_psr2_config_valid(struct
> intel_dp *intel_dp,
>  			    "PSR2 not enabled, resolution %dx%d > max
> supported %dx%d\n",
>  			    crtc_hdisplay, crtc_vdisplay,
>  			    psr_max_h, psr_max_v);
> -		return false;
> -	}
> -
> -	if (!_compute_psr2_sdp_prior_scanline_indication(intel_dp,
> crtc_state)) {
> -		drm_dbg_kms(&dev_priv->drm,
> -			    "PSR2 not enabled, PSR2 SDP indication do
> not fit in hblank\n");
> -		return false;
> -	}
> -
> -	/* Wa_16011303918:adl-p */
> -	if (crtc_state->vrr.enable &&
> -	    IS_ADLP_DISPLAY_STEP(dev_priv, STEP_A0, STEP_B0)) {
> -		drm_dbg_kms(&dev_priv->drm,
> -			    "PSR2 not enabled, not compatible with HW
> stepping + VRR\n");
> -		return false;
> +		goto unsupported;
>  	}
>  
>  	tgl_dc3co_exitline_compute_config(intel_dp, crtc_state);
>  	return true;
> +
> +unsupported:
> +	crtc_state->enable_psr2_sel_fetch = false;
> +	return false;
>  }
>  
>  void intel_psr_compute_config(struct intel_dp *intel_dp,


  parent reply	other threads:[~2022-04-13  7:29 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-12 20:55 [Intel-gfx] [PATCH 1/2] drm/i915/display/psr: Unset enable_psr2_sel_fetch if other checks in intel_psr2_config_valid() fails José Roberto de Souza
2022-04-12 20:55 ` [Intel-gfx] [PATCH 2/2] drm/i915/display/psr: Clear more PSR state during disable José Roberto de Souza
2022-04-13  7:27   ` Hogander, Jouni
2022-04-13 15:59     ` Souza, Jose
2022-04-14 11:08       ` Hogander, Jouni
2022-04-14 13:01         ` Souza, Jose
2022-04-13  7:29 ` Hogander, Jouni [this message]
2022-04-13 15:00 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/display/psr: Unset enable_psr2_sel_fetch if other checks in intel_psr2_config_valid() fails 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=f4575ddb442310862ac1cba5b9a24999dc11ef1d.camel@intel.com \
    --to=jouni.hogander@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jose.souza@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