> -----Original Message-----
> From: Intel-gfx <[email protected]> On Behalf Of Imre
> Deak
> Sent: Thursday, February 19, 2026 11:58 PM
> To: [email protected]; [email protected]
> 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 <[email protected]>
> ---
>  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.

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

Reply via email to