From: Imre Deak <imre.deak@intel.com>
To: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Subject: [PATCH v2 22/34] drm/i915/dp: Remove min/max link config limits
Date: Wed, 1 Jul 2026 18:31:51 +0300 [thread overview]
Message-ID: <20260701153204.4124150-23-imre.deak@intel.com> (raw)
In-Reply-To: <20260701153204.4124150-1-imre.deak@intel.com>
Remove the min/max rate and lane count fields from struct
link_config_limits after all state computation is converted to use the
configuration filter.
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 filter, on the other hand, always represents a
consistent set of valid configurations.
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 86 -------------------
drivers/gpu/drm/i915/display/intel_dp.h | 6 --
.../gpu/drm/i915/display/intel_dp_link_caps.c | 4 +-
.../gpu/drm/i915/display/intel_dp_link_caps.h | 2 -
drivers/gpu/drm/i915/display/intel_dp_test.c | 23 -----
5 files changed, 2 insertions(+), 119 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 79e3334d24332..16b3ab9732120 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -354,44 +354,6 @@ static int intel_dp_get_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;
- struct intel_dp_link_config forced_params;
- int lane_count;
-
- intel_dp_link_caps_get_max_limits(link_caps, &max_link_limits);
- intel_dp_link_caps_get_forced_params(link_caps, &forced_params);
-
- if (forced_params.lane_count)
- lane_count = forced_params.lane_count;
- else
- 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)
{
@@ -1540,39 +1502,6 @@ static void intel_dp_print_rates(struct intel_dp *intel_dp)
intel_dp_link_caps_print_common_rates(intel_dp->link.caps);
}
-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;
- struct intel_dp_link_config forced_params;
- int len;
-
- intel_dp_link_caps_get_forced_params(link_caps, &forced_params);
-
- if (forced_params.rate)
- return forced_params.rate;
-
- intel_dp_link_caps_get_max_limits(link_caps, &max_link_limits);
- len = intel_dp_common_len_rate_limit(link_caps, max_link_limits.rate);
-
- return intel_dp_common_rate(link_caps, len - 1);
-}
-
-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_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);
@@ -2711,18 +2640,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_filter = INTEL_DP_LINK_CAPS_FILTER_ALL;
limits->pipe.min_bpp = intel_dp_min_bpp(crtc_state->output_format);
@@ -2802,9 +2719,6 @@ intel_dp_compute_config_limits(struct intel_dp *intel_dp,
* configuration, and typically on older panels these
* values correspond to the native resolution of the panel.
*/
- limits->min_lane_count = limits->max_lane_count;
- limits->min_rate = limits->max_rate;
-
if (!intel_dp_get_connector_max_link_config(connector, limits, &max_config))
return false;
diff --git a/drivers/gpu/drm/i915/display/intel_dp.h b/drivers/gpu/drm/i915/display/intel_dp.h
index 9564369ea4852..0ec519fa12368 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.h
+++ b/drivers/gpu/drm/i915/display/intel_dp.h
@@ -28,12 +28,6 @@ struct intel_dp_link_config;
struct intel_encoder;
struct link_config_limits {
- /*
- * TODO: 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;
struct intel_dp_link_caps_filter link_config_filter;
struct {
/* Uncompressed DSC input or link output bpp in 1 bpp units */
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 4ce35b76afee6..766dc9a98e05a 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_caps.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_caps.c
@@ -242,8 +242,8 @@ intel_dp_link_caps_connector_fallback_order(bool is_mst)
}
/* Get length of common rates array potentially limited by max_rate. */
-int intel_dp_common_len_rate_limit(struct intel_dp_link_caps *link_caps,
- int max_rate)
+static int intel_dp_common_len_rate_limit(struct intel_dp_link_caps *link_caps,
+ int max_rate)
{
return intel_dp_rate_limit_len(link_caps->rates,
link_caps->num_rates, max_rate);
diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_caps.h b/drivers/gpu/drm/i915/display/intel_dp_link_caps.h
index 3c7e6c8d1ab1d..bb785c15c91f6 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_caps.h
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_caps.h
@@ -119,8 +119,6 @@ intel_dp_link_caps_connector_compute_order(struct intel_connector *connector);
struct intel_dp_link_caps_order
intel_dp_link_caps_connector_fallback_order(bool is_mst);
-int intel_dp_common_len_rate_limit(struct intel_dp_link_caps *link_caps,
- int max_rate);
int intel_dp_common_rate(struct intel_dp_link_caps *link_caps, int index);
int intel_dp_link_caps_common_rate_idx(struct intel_dp_link_caps *link_caps, int rate);
int intel_dp_max_common_rate(struct intel_dp_link_caps *link_caps);
diff --git a/drivers/gpu/drm/i915/display/intel_dp_test.c b/drivers/gpu/drm/i915/display/intel_dp_test.c
index ec7fa690910bb..0551a1ce60d39 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_test.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_test.c
@@ -114,7 +114,6 @@ bool intel_dp_test_compute_config(struct intel_connector *connector,
struct link_config_limits *limits)
{
struct intel_dp *intel_dp = intel_attached_dp(connector);
- struct intel_dp_link_caps *link_caps = intel_dp->link.caps;
struct intel_display *display = to_intel_display(intel_dp);
/* For DP Compliance we override the computed bpp for the pipe */
@@ -130,28 +129,6 @@ bool intel_dp_test_compute_config(struct intel_connector *connector,
/* Use values requested by Compliance Test Request */
if (intel_dp->compliance.test_type == DP_TEST_LINK_TRAINING) {
- int index;
-
- /*
- * TODO: Remove the following min/max link limit setup
- * after converting to use the link configuration filter
- * instead in limits.
- */
- /* Validate the compliance test data since max values
- * might have changed due to link train fallback.
- */
- if (intel_dp_link_params_valid(intel_dp, intel_dp->compliance.test_link_rate,
- intel_dp->compliance.test_lane_count)) {
- index = intel_dp_link_caps_common_rate_idx(link_caps,
- intel_dp->compliance.test_link_rate);
- if (index >= 0) {
- limits->min_rate = intel_dp->compliance.test_link_rate;
- limits->max_rate = intel_dp->compliance.test_link_rate;
- }
- limits->min_lane_count = intel_dp->compliance.test_lane_count;
- limits->max_lane_count = intel_dp->compliance.test_lane_count;
- }
-
if (!set_filter_for_link_params(connector,
intel_dp->compliance.test_link_rate,
intel_dp->compliance.test_lane_count,
--
2.49.1
next prev parent reply other threads:[~2026-07-01 15:33 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-01 15:31 [PATCH v2 00/34] drm/i915/dp_link: Unify modeset/fallback config selection Imre Deak
2026-07-01 15:31 ` [PATCH v2 01/34] drm/i915/doc: Document DP link capabilities Imre Deak
2026-07-02 5:17 ` Kandpal, Suraj
2026-07-01 15:31 ` [PATCH v2 02/34] drm/i915/dp_link_caps: Factor out helper to get link config by index Imre Deak
2026-07-03 2:55 ` Kandpal, Suraj
2026-07-01 15:31 ` [PATCH v2 03/34] drm/i915/dp_link_caps: Add support for link rate, lane count iteration orders Imre Deak
2026-07-01 15:31 ` [PATCH v2 04/34] drm/i915/dp_link_caps: Add link configuration iterator Imre Deak
2026-07-01 15:31 ` [PATCH v2 05/34] drm/i915/dp_link_caps: Add helper to get iteration order for a connector Imre Deak
2026-07-01 15:31 ` [PATCH v2 06/34] drm/i915/dp_link_caps: Validate max link limits Imre Deak
2026-07-01 15:31 ` [PATCH v2 07/34] drm/i915/dp_link_caps: Add filter for enabled link configurations Imre Deak
2026-07-01 15:31 ` [PATCH v2 08/34] drm/i915/dp_link_caps: Re-enable link configurations after a link reset Imre Deak
2026-07-01 15:31 ` [PATCH v2 09/34] drm/i915/dp_link_caps: Re-enable link configurations after sink caps change Imre Deak
2026-07-01 15:31 ` [PATCH v2 10/34] drm/i915/dp_link_caps: Drop noupdate postfix from max link limit set helpers Imre Deak
2026-07-01 15:31 ` [PATCH v2 11/34] drm/i915/dp_link_caps: Add debugfs entry showing allowed configurations Imre Deak
2026-07-02 10:35 ` Luca Coelho
2026-07-01 15:31 ` [PATCH v2 12/34] drm/i915/dp: Add link configuration filter for modeset computation Imre Deak
2026-07-02 11:03 ` Luca Coelho
2026-07-01 15:31 ` [PATCH v2 13/34] drm/i915/dp_link_caps: Add helper to query max BW link configuration Imre Deak
2026-07-02 11:06 ` Luca Coelho
2026-07-01 15:31 ` [PATCH v2 14/34] drm/i915/dp: Query max BW config via link_caps during mode validation Imre Deak
2026-07-02 11:22 ` Luca Coelho
2026-07-01 15:31 ` [PATCH v2 15/34] drm/i915/dp_tunnel: Query max BW config via link_caps for BW computation Imre Deak
2026-07-02 11:23 ` Luca Coelho
2026-07-01 15:31 ` [PATCH v2 16/34] drm/i915/dp_test: Use link caps for compliance link configs Imre Deak
2026-07-02 16:19 ` Luca Coelho
2026-07-01 15:31 ` [PATCH v2 17/34] drm/i915/dp: Iterate configurations via link_caps for SST non-DSC Imre Deak
2026-07-01 15:31 ` [PATCH v2 18/34] drm/i915/dp: Iterate configurations via link_caps for SST DSC Imre Deak
2026-07-01 15:31 ` [PATCH v2 19/34] drm/i915/dp: Use link caps for eDP DSC config selection Imre Deak
2026-07-01 15:31 ` [PATCH v2 20/34] drm/i915/dp_mst: Use link caps for non-DSC " Imre Deak
2026-07-01 15:31 ` [PATCH v2 21/34] drm/i915/dp_mst: Use link caps for MST DSC " Imre Deak
2026-07-01 15:31 ` Imre Deak [this message]
2026-07-01 15:31 ` [PATCH v2 23/34] drm/i915/dp_link_training: Reset the max link limits in the fallback code Imre Deak
2026-07-01 15:31 ` [PATCH v2 24/34] drm/i915/dp_link_training: Use config iterator for fallback Imre Deak
2026-07-01 15:31 ` [PATCH v2 25/34] drm/i915/dp_link_training: Disable failed config during fallback Imre Deak
2026-07-01 15:31 ` [PATCH v2 26/34] drm/i915/kunit: Enable KUnit tests Imre Deak
2026-07-01 15:31 ` [PATCH v2 27/34] drm/i915/kunit: Add DP link test stub Imre Deak
2026-07-01 15:31 ` [PATCH v2 28/34] drm/xe/kunit: Add display test config Imre Deak
2026-07-01 15:31 ` [PATCH v2 29/34] drm/xe/kunit: Build DP link display tests Imre Deak
2026-07-01 15:31 ` [PATCH v2 30/34] drm/i915/kunit: Setup DP link test context Imre Deak
2026-07-01 15:32 ` [PATCH v2 31/34] drm/i915/kunit: Export link training and caps funcs for testing Imre Deak
2026-07-01 15:32 ` [PATCH v2 32/34] drm/i915/kunit: DP link: add baseline fixed table reference test Imre Deak
2026-07-01 15:32 ` [PATCH v2 33/34] drm/i915/kunit: DP link: add update config tests Imre Deak
2026-07-01 15:32 ` [PATCH v2 34/34] drm/i915/kunit: DP link: add fallback tests Imre Deak
2026-07-01 16:39 ` ✗ CI.checkpatch: warning for drm/i915/dp_link: Unify modeset/fallback config selection Patchwork
2026-07-01 16:40 ` ✓ CI.KUnit: success " Patchwork
2026-07-01 16:59 ` ✗ CI.checksparse: warning " Patchwork
2026-07-01 17:43 ` ✓ Xe.CI.BAT: success " Patchwork
2026-07-02 12:25 ` ✓ Xe.CI.FULL: " 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=20260701153204.4124150-23-imre.deak@intel.com \
--to=imre.deak@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