[PATCH 097/108] drm/i915/dp: Remove min/max link config limits

Imre Deak
2026-04-28T12:55:36Z

Remove the min/max rate and lane count fields from struct
link_config_limits after all state computation is converted to use the
configuration mask.

A simple min/max range cannot fully describe the valid configuration
set once individual configurations are disabled (for example by
fallback), as it may allow combinations that are not actually valid.
The configuration mask, on the other hand, always represents a
consistent set of allowed configurations.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 72 -------------------------
drivers/gpu/drm/i915/display/intel_dp.h | 7 ---
2 files changed, 79 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index d577cdb1dc4e7..16ead049b5bf8 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -352,38 +352,6 @@ static int intel_dp_max_common_lane_count(struct intel_dp *intel_dp)
return min3(source_max, sink_max, lane_max);
}

-static int intel_dp_max_lane_count(struct intel_dp *intel_dp)
-{
- struct intel_dp_link_caps *link_caps = intel_dp->link.caps;
- struct intel_dp_link_config max_link_limits;
- int lane_count;
-
- intel_dp_link_caps_get_max_limits(link_caps, &max_link_limits);
- lane_count = max_link_limits.lane_count;
-
- switch (lane_count) {
- case 1:
- case 2:
- case 4:
- return lane_count;
- default:
- MISSING_CASE(lane_count);
- return 1;
- }
-}
-
-static int intel_dp_min_lane_count(struct intel_dp *intel_dp)
-{
- struct intel_dp_link_config forced_params;
-
- intel_dp_link_caps_get_forced_params(intel_dp->link.caps, &forced_params);
-
- if (forced_params.lane_count)
- return forced_params.lane_count;
-
- return 1;
-}
-
int intel_dp_link_bw_overhead(int link_clock, int lane_count, int hdisplay,
int dsc_slice_count, int bpp_x16, unsigned long flags)
{
@@ -1552,31 +1520,6 @@ static void intel_dp_print_rates(struct intel_dp *intel_dp)
drm_dbg_kms(display->drm, "common rates: %s\n", seq_buf_str(&s));
}

-static int
-intel_dp_max_link_rate(struct intel_dp *intel_dp)
-{
- struct intel_dp_link_caps *link_caps = intel_dp->link.caps;
- struct intel_dp_link_config max_link_limits;
-
- intel_dp_link_caps_get_max_limits(link_caps, &max_link_limits);
-
- return max_link_limits.rate;
-}
-
-static int
-intel_dp_min_link_rate(struct intel_dp *intel_dp)
-{
- struct intel_dp_link_caps *link_caps = intel_dp->link.caps;
- struct intel_dp_link_config forced_params;
-
- intel_dp_link_caps_get_forced_params(intel_dp->link.caps, &forced_params);
-
- if (forced_params.rate)
- return forced_params.rate;
-
- return intel_dp_link_caps_common_rate(link_caps, 0);
-}
-
int intel_dp_rate_select(struct intel_dp *intel_dp, int rate)
{
struct intel_display *display = to_intel_display(intel_dp);
@@ -2692,18 +2635,6 @@ intel_dp_compute_config_limits(struct intel_dp *intel_dp,
struct intel_connector *connector =
to_intel_connector(conn_state->connector);

- /*
- * Remove the following min/max rate and lane count setup, once
- * all users are converted to use link_config_mask instead.
- */
- limits->min_rate = intel_dp_min_link_rate(intel_dp);
- limits->max_rate = intel_dp_max_link_rate(intel_dp);
-
- limits->min_rate = min(limits->min_rate, limits->max_rate);
-
- limits->min_lane_count = intel_dp_min_lane_count(intel_dp);
- limits->max_lane_count = intel_dp_max_lane_count(intel_dp);
-
limits->link_config_mask = intel_dp_link_caps_get_allowed_config_mask(link_caps);

limits->pipe.min_bpp = intel_dp_min_bpp(crtc_state->output_format);
@@ -2782,9 +2713,6 @@ intel_dp_compute_config_limits(struct intel_dp *intel_dp,
*/
int max_config_idx;

- limits->min_lane_count = limits->max_lane_count;
- limits->min_rate = limits->max_rate;
-
max_config_idx = intel_dp_get_connector_max_link_config_idx(connector,
limits);
if (max_config_idx < 0)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
index bfba29ba715d5..c4bad94524c52 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -26,13 +26,6 @@ struct intel_dp_link_config;
struct intel_encoder;

struct link_config_limits {
- /*
- * Remove the following min/max rate and lane count limits
- * once all users are converted to use link_config_mask
- * instead.
- */
- int min_rate, max_rate;
- int min_lane_count, max_lane_count;
u32 link_config_mask;
struct {
/* Uncompressed DSC input or link output bpp in 1 bpp units */
--
2.49.1