summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorImre Deak <imre.deak@intel.com>2026-02-19 21:28:20 +0300
committerImre Deak <imre.deak@intel.com>2026-02-25 16:30:11 +0300
commit02feab823760cf08272b12901776e117616f1047 (patch)
treeed6497a84584b8f2075a10b364c8c34da27a8cb8
parentafe3f74716235f9c137e9850ee0027391b46b570 (diff)
downloadlinux-02feab823760cf08272b12901776e117616f1047.tar.xz
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. Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Link: https://patch.msgid.link/20260219182823.926702-3-imre.deak@intel.com
-rw-r--r--drivers/gpu/drm/i915/display/intel_dp_tunnel.c18
1 files 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 633706274c9c..b95fdafa3d36 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);
}
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,