Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Mohammed Bilal <mohammed.bilal@intel.com>,
	intel-xe@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: suraj.kandpal@intel.com, Mohammed Bilal <mohammed.bilal@intel.com>
Subject: Re: [PATCH v1] drm/i915/debugfs: Add i915_extended_wakeup_timeout debugfs entry
Date: Tue, 24 Feb 2026 14:26:16 +0200	[thread overview]
Message-ID: <cc5493055fc914166fc4b2395ca0370f53332a9d@intel.com> (raw)
In-Reply-To: <20260224083734.2947885-1-mohammed.bilal@intel.com>

On Tue, 24 Feb 2026, Mohammed Bilal <mohammed.bilal@intel.com> wrote:
> Add debugfs interface to expose extended wakeup timeout information for
> DP connectors. This shows whether a retimer is present, the
> current mode (transparent vs non-transparent), and the wakeup timeout
> value in milliseconds.
> This helps verify whether the extended wakeup timeout is functioning
> as expected.
>
> Signed-off-by: Mohammed Bilal <mohammed.bilal@intel.com>

Do we really have to add debugfs for things that are just DPCD reads? We
have the DP AUX device exposed, and a userspace tool could read all of
this through that. It's much more pain to maintain this in the kernel.

BR,
Jani.

> ---
>  .../drm/i915/display/intel_display_debugfs.c  | 78 +++++++++++++++++++
>  1 file changed, 78 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index 2614c4863c87..292ee71643da 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -1310,6 +1310,78 @@ static const struct file_operations i915_joiner_fops = {
>  	.write = i915_joiner_write
>  };
>  
> +static int i915_extended_wakeup_timeout_show(struct seq_file *m, void *data)
> +{
> +	struct intel_connector *connector = m->private;
> +	struct intel_display *display = to_intel_display(connector);
> +	struct intel_encoder *encoder = intel_attached_encoder(connector);
> +	struct intel_dp *intel_dp;
> +	bool retimer_present = false;
> +	bool transparent_mode = true;
> +	int wakeup_timeout_ms = 1;
> +	int lttpr_count;
> +	u8 val;
> +	int ret;
> +
> +	if (!encoder)
> +		return -ENODEV;
> +
> +	ret = drm_modeset_lock_single_interruptible(&display->drm->mode_config.connection_mutex);
> +	if (ret)
> +		return ret;
> +	if (connector->base.status != connector_status_connected) {
> +		ret = -ENODEV;
> +		goto out;
> +	}
> +
> +	intel_dp = enc_to_intel_dp(encoder);
> +	lttpr_count = drm_dp_lttpr_count(intel_dp->lttpr_common_caps);
> +	retimer_present = (lttpr_count > 0);
> +	transparent_mode = intel_dp_lttpr_transparent_mode_enabled(intel_dp);
> +
> +	if (transparent_mode) {
> +		ret = drm_dp_dpcd_read_data(&intel_dp->aux,
> +					    DP_EXTENDED_DPRX_SLEEP_WAKE_TIMEOUT_REQUEST,
> +					    &val, 1);
> +		if (!ret) {
> +			static const u8 timeout_mapping[] = {
> +				[DP_DPRX_SLEEP_WAKE_TIMEOUT_PERIOD_1_MS] = 1,
> +				[DP_DPRX_SLEEP_WAKE_TIMEOUT_PERIOD_20_MS] = 20,
> +				[DP_DPRX_SLEEP_WAKE_TIMEOUT_PERIOD_40_MS] = 40,
> +				[DP_DPRX_SLEEP_WAKE_TIMEOUT_PERIOD_60_MS] = 60,
> +				[DP_DPRX_SLEEP_WAKE_TIMEOUT_PERIOD_80_MS] = 80,
> +				[DP_DPRX_SLEEP_WAKE_TIMEOUT_PERIOD_100_MS] = 100,
> +			};
> +
> +			if (val < ARRAY_SIZE(timeout_mapping) && timeout_mapping[val])
> +				wakeup_timeout_ms = timeout_mapping[val];
> +		}
> +	} else {
> +		ret = drm_dp_dpcd_read_data(&intel_dp->aux,
> +					    DP_PHY_REPEATER_EXTENDED_WAIT_TIMEOUT,
> +					    &val, 1);
> +
> +		if (!ret) {
> +
> +			int timeout_val = val & DP_EXTENDED_WAKE_TIMEOUT_REQUEST_MASK;
> +
> +			wakeup_timeout_ms = timeout_val ? (timeout_val * 10) : 1;
> +		}
> +	}
> +
> +	if (ret)
> +		wakeup_timeout_ms = -1;
> +
> +	seq_printf(m, "retimer_present: %s\n", retimer_present ? "yes" : "no");
> +	seq_printf(m, "mode: %s\n", transparent_mode ? "transparent" : "non-transparent");
> +	seq_printf(m, "wakeup_timeout_ms: %d\n", wakeup_timeout_ms);
> +
> +out:
> +	drm_modeset_unlock(&display->drm->mode_config.connection_mutex);
> +	return ret;
> +}
> +DEFINE_SHOW_ATTRIBUTE(i915_extended_wakeup_timeout);
> +
>  /**
>   * intel_connector_debugfs_add - add i915 specific connector debugfs files
>   * @connector: pointer to a registered intel_connector
> @@ -1335,6 +1407,12 @@ void intel_connector_debugfs_add(struct intel_connector *connector)
>  	intel_dp_link_training_debugfs_add(connector);
>  	intel_link_bw_connector_debugfs_add(connector);
>  
> +	if (DISPLAY_VER(display) >= 30 &&
> +	    connector_type == DRM_MODE_CONNECTOR_DisplayPort && !connector->mst.dp) {
> +		debugfs_create_file("i915_extended_wakeup_timeout", 0444, root,
> +				    connector, &i915_extended_wakeup_timeout_fops);
> +	}
> +
>  	if (DISPLAY_VER(display) >= 11 &&
>  	    ((connector_type == DRM_MODE_CONNECTOR_DisplayPort && !connector->mst.dp) ||
>  	     connector_type == DRM_MODE_CONNECTOR_eDP)) {

-- 
Jani Nikula, Intel

      parent reply	other threads:[~2026-02-24 12:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-24  8:37 [PATCH v1] drm/i915/debugfs: Add i915_extended_wakeup_timeout debugfs entry Mohammed Bilal
2026-02-24  8:57 ` ✗ CI.checkpatch: warning for " Patchwork
2026-02-24  8:58 ` ✓ CI.KUnit: success " Patchwork
2026-02-24 12:26 ` Jani Nikula [this message]

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=cc5493055fc914166fc4b2395ca0370f53332a9d@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=mohammed.bilal@intel.com \
    --cc=suraj.kandpal@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