Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
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 v3 5/6] drm/i915/lobf: Check for sink error and disable LOBF
Date: Wed, 8 Jan 2025 14:07:34 +0000	[thread overview]
Message-ID: <abac0c98f5435ba2ac7e70c7a0bf4247ec225630.camel@intel.com> (raw)
In-Reply-To: <20250106041516.924101-6-animesh.manna@intel.com>

On Mon, 2025-01-06 at 09:45 +0530, Animesh Manna wrote:
> Disable LOBF/ALPM for any erroneous condition from sink side.
> 
> Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_alpm.c     | 38
> +++++++++++++++++++
>  drivers/gpu/drm/i915/display/intel_alpm.h     |  1 +
>  .../drm/i915/display/intel_display_types.h    |  1 +
>  drivers/gpu/drm/i915/display/intel_dp.c       |  2 +
>  4 files changed, 42 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.c
> b/drivers/gpu/drm/i915/display/intel_alpm.c
> index 1cc0e5ed3f74..ab98b48ec47e 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.c
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.c
> @@ -388,6 +388,7 @@ void intel_alpm_configure(struct intel_dp
> *intel_dp,
>  			  const struct intel_crtc_state *crtc_state)
>  {
>  	lnl_alpm_configure(intel_dp, crtc_state);
> +	intel_dp->alpm_parameters.transcoder = crtc_state-
> >cpu_transcoder;
>  }
>  
>  void intel_alpm_post_plane_update(struct intel_atomic_state *state,
> @@ -511,3 +512,40 @@ void intel_alpm_lobf_debugfs_add(struct
> intel_connector *connector)
>  	debugfs_create_file("i915_edp_lobf_info", 0444, root,
>  			    connector, &i915_edp_lobf_info_fops);
>  }
> +
> +void intel_alpm_short_pulse(struct intel_dp *intel_dp)
> +{
> +	struct intel_display *display = to_intel_display(intel_dp);
> +	struct drm_dp_aux *aux = &intel_dp->aux;
> +	enum transcoder cpu_transcoder = intel_dp-
> >alpm_parameters.transcoder;
> +	u8 val;
> +	int r;
> +
> +	if (DISPLAY_VER(display) < 20)
> +		return;
> +
> +	if (!(intel_de_read(display, ALPM_CTL(display,
> cpu_transcoder)) & ALPM_CTL_LOBF_ENABLE))
> +		return;
> +
> +	r = drm_dp_dpcd_readb(aux, DP_RECEIVER_ALPM_STATUS, &val);
> +	if (r != 1) {
> +		drm_err(display->drm, "Error reading ALPM
> status\n");
> +		return;
> +	}
> +
> +	if (val & DP_ALPM_LOCK_TIMEOUT_ERROR) {
> +		intel_de_rmw(display, ALPM_CTL(display,
> cpu_transcoder),
> +			     ALPM_CTL_ALPM_ENABLE |
> ALPM_CTL_LOBF_ENABLE |
> +			     ALPM_CTL_ALPM_AUX_LESS_ENABLE, 0);
> +
> +		intel_de_rmw(display,
> +			     PORT_ALPM_CTL(cpu_transcoder),
> +			     PORT_ALPM_CTL_ALPM_AUX_LESS_ENABLE, 0);
> +
> +		drm_dbg_kms(display->drm,
> +			    "ALPM lock timeout error, disabling
> LOBF\n");
> +
> +		/* Clearing error */
> +		drm_dp_dpcd_writeb(aux, DP_RECEIVER_ALPM_STATUS,
> val);
> +	}
> +}

I think we should centralize this. Either into intel_psr.c or here. I
think you should have locking for accessing ALPM_CTL register. Should
we have also own flag telling alpm_compute_config that we don't want to
use LOBF?

BR,

Jouni Högander

> diff --git a/drivers/gpu/drm/i915/display/intel_alpm.h
> b/drivers/gpu/drm/i915/display/intel_alpm.h
> index 485e511629fb..96d4c903f3ea 100644
> --- a/drivers/gpu/drm/i915/display/intel_alpm.h
> +++ b/drivers/gpu/drm/i915/display/intel_alpm.h
> @@ -29,4 +29,5 @@ void intel_alpm_post_plane_update(struct
> intel_atomic_state *state,
>  void intel_alpm_lobf_debugfs_add(struct intel_connector *connector);
>  bool intel_alpm_aux_wake_supported(struct intel_dp *intel_dp);
>  bool intel_alpm_aux_less_wake_supported(struct intel_dp *intel_dp);
> +void intel_alpm_short_pulse(struct intel_dp *intel_dp);
>  #endif
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h
> b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 37f061acb204..636af4c4e94d 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -1806,6 +1806,7 @@ struct intel_dp {
>  #define I915_LOBF_DEBUG_DISABLE			0x01
>  #define I915_LOBF_DEBUG_FORCE_EN		0x02
>  		bool lobf_debug;
> +		enum transcoder transcoder;
>  	} alpm_parameters;
>  
>  	u8 alpm_dpcd;
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index 0d74adae2ec9..40f2760d8aaa 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -5363,6 +5363,8 @@ intel_dp_short_pulse(struct intel_dp *intel_dp)
>  
>  	intel_psr_short_pulse(intel_dp);
>  
> +	intel_alpm_short_pulse(intel_dp);
> +
>  	if (intel_dp_test_short_pulse(intel_dp))
>  		reprobe_needed = true;
>  


  reply	other threads:[~2025-01-08 14:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-06  4:15 [PATCH v3 0/6] LOBF enablement fix Animesh Manna
2025-01-06  4:15 ` [PATCH v3 1/6] drm/i915/lobf: Add lobf enablement in post plane update Animesh Manna
2025-01-06  4:15 ` [PATCH v3 2/6] drm/i915/lobf: Add fixed refresh rate check in compute_config() Animesh Manna
2025-01-06  4:15 ` [PATCH v3 3/6] drm/i915/lobf: Update lobf if any change in dependent parameters Animesh Manna
2025-01-08 12:56   ` Hogander, Jouni
2025-01-06  4:15 ` [PATCH v3 4/6] drm/i915/lobf: Add debug interface for lobf Animesh Manna
2025-01-08 13:01   ` Hogander, Jouni
2025-01-08 14:02     ` Jani Nikula
2025-01-06  4:15 ` [PATCH v3 5/6] drm/i915/lobf: Check for sink error and disable LOBF Animesh Manna
2025-01-08 14:07   ` Hogander, Jouni [this message]
2025-01-06  4:15 ` [PATCH v3 6/6] drm/i915/lobf: Add debug print for LOBF Animesh Manna
2025-01-06  5:32 ` ✓ CI.Patch_applied: success for LOBF enablement fix (rev2) Patchwork
2025-01-06  5:33 ` ✓ CI.checkpatch: " Patchwork
2025-01-06  5:34 ` ✓ CI.KUnit: " Patchwork
2025-01-06  5:52 ` ✓ CI.Build: " Patchwork
2025-01-06  5:54 ` ✓ CI.Hooks: " Patchwork
2025-01-06  5:56 ` ✗ CI.checksparse: warning " Patchwork
2025-01-06  6:23 ` ✓ Xe.CI.BAT: success " Patchwork
2025-01-06  9:27 ` ✗ Xe.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=abac0c98f5435ba2ac7e70c7a0bf4247ec225630.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