From: Imre Deak <imre.deak@intel.com>
To: "Murthy, Arun R" <arun.r.murthy@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 2/5] drm/i915/dp_tunnel: Simplify detection of link BW change
Date: Mon, 23 Feb 2026 18:35:24 +0200 [thread overview]
Message-ID: <aZyBzNZYecyQxdvK@ideak-desk.lan> (raw)
In-Reply-To: <IA0PR11MB7307F5E3DF179F283F94D4A7BA77A@IA0PR11MB7307.namprd11.prod.outlook.com>
On Mon, Feb 23, 2026 at 06:02:26PM +0200, Murthy, Arun R wrote:
>
> > -----Original Message-----
> > From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of Imre
> > Deak
> > Sent: Thursday, February 19, 2026 11:58 PM
> > To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> > Subject: [PATCH 2/5] drm/i915/dp_tunnel: Simplify detection of link BW change
> >
> > update_tunnel_state() checks whether a tunnel state change (e.g.
> > available tunnel bandwidth) affects the list of valid modes for the sink
> > connected through the tunnel. If so, its caller sends a hotplug event so
> > userspace can re-enumerate the modes.
> >
> > A change in tunnel bandwidth does not affect the mode list if the bandwidth
> > was above the sink's DPRX bandwidth both before and after the update, since in
> > that case the effective bandwidth remains limited by the DPRX.
> >
> > As get_current_link_bw() via intel_dp_max_link_data_rate() already returns
> > bandwidth values clamped to the DPRX limit, the condition for detecting a
> > mode list change can be simplified to:
> >
> > old_bw != new_bw
> >
> > Remove the explicit checks for whether the bandwidth was below the
> > maximum DPRX bandwidth before and after the update, and rely on the
> > clamped bandwidth values instead.
> >
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> > drivers/gpu/drm/i915/display/intel_dp_tunnel.c | 18 +++++-------------
> > 1 file changed, 5 insertions(+), 13 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
> > b/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
> > index eb1eed1c8c7bb..9f3750035f68e 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
> > @@ -54,30 +54,23 @@ static int kbytes_to_mbits(int kbytes)
> > return DIV_ROUND_UP(kbytes * 8, 1000); }
> >
> > -static int get_current_link_bw(struct intel_dp *intel_dp,
> > - bool *below_dprx_bw)
> > +static int get_current_link_bw(struct intel_dp *intel_dp)
> > {
> > int rate = intel_dp_max_common_rate(intel_dp);
> > int lane_count = intel_dp_max_common_lane_count(intel_dp);
> > - int bw;
> >
> > - bw = intel_dp_max_link_data_rate(intel_dp, rate, lane_count);
> > - *below_dprx_bw = bw < drm_dp_max_dprx_data_rate(rate,
> > lane_count);
> > -
> > - return bw;
> > + return intel_dp_max_link_data_rate(intel_dp, rate, lane_count);
> > }
>
> Function name says get the current data rate, but we are returning the
> max data rate here.
It is the current link bandwidth, i.e., the link bandwidth allowed by
the Thunderbolt Connection Manager at the moment. It is not a maximum
(which could refer either to the maximum DPRX bandwidth or the maximum
Thunderbolt bandwidth), but rather the amount allowed by all other
components on the Thunderbolt link sharing the same bandwidth.
>
> Thanks and Regards,
> Arun R Murthy
> -------------------
> >
> > static int update_tunnel_state(struct intel_dp *intel_dp) {
> > struct intel_display *display = to_intel_display(intel_dp);
> > struct intel_encoder *encoder = &dp_to_dig_port(intel_dp)->base;
> > - bool old_bw_below_dprx;
> > - bool new_bw_below_dprx;
> > int old_bw;
> > int new_bw;
> > int ret;
> >
> > - old_bw = get_current_link_bw(intel_dp, &old_bw_below_dprx);
> > + old_bw = get_current_link_bw(intel_dp);
> >
> > ret = drm_dp_tunnel_update_state(intel_dp->tunnel);
> > if (ret < 0) {
> > @@ -96,11 +89,10 @@ static int update_tunnel_state(struct intel_dp
> > *intel_dp)
> >
> > intel_dp_update_sink_caps(intel_dp);
> >
> > - new_bw = get_current_link_bw(intel_dp, &new_bw_below_dprx);
> > + new_bw = get_current_link_bw(intel_dp);
> >
> > /* Suppress the notification if the mode list can't change due to bw. */
> > - if (old_bw_below_dprx == new_bw_below_dprx &&
> > - !new_bw_below_dprx)
> > + if (old_bw == new_bw)
> > return 0;
> >
> > drm_dbg_kms(display->drm,
> > --
> > 2.49.1
>
next prev parent reply other threads:[~2026-02-23 16:35 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-19 18:28 [PATCH 0/5] drm/i915/dp_tunnel: Preparation for UHBR DP tunnels Imre Deak
2026-02-19 18:28 ` [PATCH 1/5] drm/i915/dp_tunnel: Don't update tunnel state during system resume Imre Deak
2026-02-23 15:54 ` Murthy, Arun R
2026-02-23 16:30 ` Imre Deak
2026-02-24 2:33 ` Murthy, Arun R
2026-02-24 7:49 ` Imre Deak
2026-02-24 12:55 ` Murthy, Arun R
2026-02-19 18:28 ` [PATCH 2/5] drm/i915/dp_tunnel: Simplify detection of link BW change Imre Deak
2026-02-23 16:02 ` Murthy, Arun R
2026-02-23 16:35 ` Imre Deak [this message]
2026-02-24 12:56 ` Murthy, Arun R
2026-02-19 18:28 ` [PATCH 3/5] drm/i915/dp_tunnel: Split update_tunnel_state() Imre Deak
2026-02-24 12:57 ` Murthy, Arun R
2026-02-19 18:28 ` [PATCH 4/5] drm/i915/dp_tunnel: Sanitize documentation of intel_dp_tunnel_detect() Imre Deak
2026-02-23 16:12 ` Murthy, Arun R
2026-02-23 16:45 ` Imre Deak
2026-02-24 2:36 ` Murthy, Arun R
2026-02-24 7:55 ` Imre Deak
2026-02-24 12:55 ` Murthy, Arun R
2026-02-19 18:28 ` [PATCH 5/5] drm/i915/dp_tunnel: Send BW change notification after tunnel creation Imre Deak
2026-02-24 12:58 ` Murthy, Arun R
2026-02-19 19:28 ` ✓ CI.KUnit: success for drm/i915/dp_tunnel: Preparation for UHBR DP tunnels Patchwork
2026-02-20 8:42 ` ✓ Xe.CI.BAT: " Patchwork
2026-02-20 13:42 ` ✗ 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=aZyBzNZYecyQxdvK@ideak-desk.lan \
--to=imre.deak@intel.com \
--cc=arun.r.murthy@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
/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