From ba4680dece956cd576ba827432f97428c9e926b7 Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Tue, 16 Jun 2026 23:08:45 +0300 Subject: [PATCH] drm/i915/dp_link_caps: Move max link limits to link_caps Now that all users access the max link limits via helpers, move tracking of these limits from struct intel_dp to the link_caps state. Reviewed-by: Nemesa Garg Signed-off-by: Imre Deak Link: https://patch.msgid.link/20260616200849.3534628-26-imre.deak@intel.com --- .../drm/i915/display/intel_display_types.h | 4 ---- .../gpu/drm/i915/display/intel_dp_link_caps.c | 21 ++++++++++++------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index e5492996b9e4..c048da7d6fea 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -1839,10 +1839,6 @@ struct intel_dp { struct { /* TODO: move the rest of link specific fields to here */ bool active; - /* Max lane count for the current link */ - int max_lane_count; - /* Max rate for the current link */ - int max_rate; /* * Link parameters for which the MST topology was probed. * Tracking these ensures that the MST path resources are diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_caps.c b/drivers/gpu/drm/i915/display/intel_dp_link_caps.c index 9b7da5a64ee2..43427e7cf422 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_link_caps.c +++ b/drivers/gpu/drm/i915/display/intel_dp_link_caps.c @@ -46,6 +46,17 @@ struct intel_dp_link_caps { * disconnects. */ struct intel_dp_link_config forced_params; + + /* + * User set maximum limits. These limits constrain the currently + * allowed set of configurations and are not adjusted when sink + * capabilities change. + * + * max_limits.rate/lane_count may come from different allowed + * configurations, i.e. the (max_limits.rate, max_limits.lane_count) + * tuple itself may not be an allowed configuration. + */ + struct intel_dp_link_config max_limits; }; /* Get length of common rates array potentially limited by max_rate. */ @@ -154,10 +165,7 @@ static int intel_dp_link_config_lane_count(const struct intel_dp_link_config_ent static void set_max_link_limits_no_update(struct intel_dp_link_caps *link_caps, const struct intel_dp_link_config *max_link_limits) { - struct intel_dp *intel_dp = link_caps->dp; - - intel_dp->link.max_rate = max_link_limits->rate; - intel_dp->link.max_lane_count = max_link_limits->lane_count; + link_caps->max_limits = *max_link_limits; } static void reset_max_link_limits_no_update(struct intel_dp_link_caps *link_caps) @@ -194,10 +202,7 @@ static void reset_max_link_limits_no_update(struct intel_dp_link_caps *link_caps void intel_dp_link_caps_get_max_limits(struct intel_dp_link_caps *link_caps, struct intel_dp_link_config *max_link_limits) { - struct intel_dp *intel_dp = link_caps->dp; - - max_link_limits->rate = intel_dp->link.max_rate; - max_link_limits->lane_count = intel_dp->link.max_lane_count; + *max_link_limits = link_caps->max_limits; } /**