Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Kunal Joshi <kunal1.joshi@intel.com>
To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Cc: imre.deak@intel.com, jani.nikula@intel.com,
	Kunal Joshi <kunal1.joshi@intel.com>
Subject: [RFC 4/7] drm/i915/dp_tunnel: Wire up DP tunnel debugfs from DRM core
Date: Mon, 11 May 2026 11:10:25 +0530	[thread overview]
Message-ID: <20260511054028.1310995-5-kunal1.joshi@intel.com> (raw)
In-Reply-To: <20260511054028.1310995-1-kunal1.joshi@intel.com>

The DRM-core tunnel debugfs helpers need a driver-side call site.
Wire them into detect_new_tunnel() so the dp_tunnel/ subdir is
created once the tunnel's BWA state has settled, giving IGT and
developers access to the tunnel info/knobs through debugfs.

The helper is invoked on all three retained-tunnel branches in
detect_new_tunnel() (BWA unsupported, BWA enable failure, and
successful state update). Error paths that destroy the tunnel
do not register debugfs.

Cc: Imre Deak <imre.deak@intel.com>
Assisted-by: Copilot:claude-sonnet-4-6
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
---
 .../gpu/drm/i915/display/intel_dp_tunnel.c    | 23 ++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_tunnel.c b/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
index 11712a151f729..cc36d5651f6a9 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
@@ -16,6 +16,17 @@
 #include "intel_dp_tunnel.h"
 #include "intel_link_bw.h"
 
+static void intel_dp_tunnel_debugfs_add(struct intel_dp *intel_dp)
+{
+	struct intel_connector *connector = intel_dp->attached_connector;
+
+	if (!connector || !intel_dp->tunnel)
+		return;
+
+	drm_dp_tunnel_debugfs_add(intel_dp->tunnel,
+				  connector->base.debugfs_entry);
+}
+
 struct intel_dp_tunnel_inherited_state {
 	struct drm_dp_tunnel_ref ref[I915_MAX_PIPES];
 };
@@ -214,8 +225,10 @@ static int detect_new_tunnel(struct intel_dp *intel_dp, struct drm_modeset_acqui
 
 	ret = drm_dp_tunnel_enable_bw_alloc(intel_dp->tunnel);
 	if (ret) {
-		if (ret == -EOPNOTSUPP)
+		if (ret == -EOPNOTSUPP) {
+			intel_dp_tunnel_debugfs_add(intel_dp);
 			return 0;
+		}
 
 		drm_dbg_kms(display->drm,
 			    "[DPTUN %s][ENCODER:%d:%s] Failed to enable BW allocation mode (ret %pe)\n",
@@ -224,6 +237,7 @@ static int detect_new_tunnel(struct intel_dp *intel_dp, struct drm_modeset_acqui
 			    ERR_PTR(ret));
 
 		/* Keep the tunnel with BWA disabled */
+		intel_dp_tunnel_debugfs_add(intel_dp);
 		return 0;
 	}
 
@@ -238,6 +252,13 @@ static int detect_new_tunnel(struct intel_dp *intel_dp, struct drm_modeset_acqui
 	if (ret)
 		return ret;
 
+	/*
+	 * Register debugfs only after BWA negotiation has fully
+	 * settled so the first read of 'info' shows steady-state
+	 * values rather than transient ones.
+	 */
+	intel_dp_tunnel_debugfs_add(intel_dp);
+
 	return has_tunnel_bw_changed(intel_dp, old_bw) ? 1 : 0;
 }
 
-- 
2.25.1


  parent reply	other threads:[~2026-05-11  5:19 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-11  5:40 [RFC 0/7] drm/display/dp_tunnel: Add debugfs surface for BWA validation Kunal Joshi
2026-05-11  5:40 ` [RFC 1/7] drm/display/dp_tunnel: Add debugfs interface with info file Kunal Joshi
2026-05-11  5:40 ` [RFC 2/7] drm/display/dp_tunnel: Add bw_alloc_enable debugfs knob Kunal Joshi
2026-05-11  5:40 ` [RFC 3/7] drm/display/dp_tunnel: Add bw_limit debugfs cap for BW pressure injection Kunal Joshi
2026-05-11  5:40 ` Kunal Joshi [this message]
2026-05-11  5:40 ` [RFC 5/7] drm/i915/display: Expose DP tunnel debugfs under each connector Kunal Joshi
2026-05-11  5:40 ` [RFC 6/7] drm/display/dp_tunnel: Sync SW allocated_bw after enabling BW alloc Kunal Joshi
2026-05-11  5:40 ` [RFC 7/7] drm/i915/dp_tunnel: Re-attach dp_tunnel debugfs to MST children on re-detect Kunal Joshi
2026-05-11 14:54 ` ✓ i915.CI.BAT: success for drm/display/dp_tunnel: Add debugfs surface for BWA validation Patchwork
2026-05-11 20:10 ` ✗ i915.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=20260511054028.1310995-5-kunal1.joshi@intel.com \
    --to=kunal1.joshi@intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@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