[PATCH 058/108] drm/i915/dp_link_caps: Add link_caps prefix to common rate helpers

Imre Deak
2026-04-28T12:54:49Z

Rename the common rate helpers in intel_dp_link_caps.c to use the
intel_dp_link_caps_ prefix, matching the other exported functions in
the file.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
drivers/gpu/drm/i915/display/intel_dp.c | 6 ++---
.../gpu/drm/i915/display/intel_dp_link_caps.c | 24 +++++++++----------
.../gpu/drm/i915/display/intel_dp_link_caps.h | 4 ++--
.../drm/i915/display/intel_dp_link_training.c | 4 ++--
.../gpu/drm/i915/display/intel_dp_tunnel.c | 2 +-
5 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 57f5c73f4c249..88154352e1faa 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1573,7 +1573,7 @@ intel_dp_min_link_rate(struct intel_dp *intel_dp)
if (forced_params.rate)
return forced_params.rate;

- return intel_dp_common_rate(link_caps, 0);
+ return intel_dp_link_caps_common_rate(link_caps, 0);
}

int intel_dp_rate_select(struct intel_dp *intel_dp, int rate)
@@ -1768,7 +1768,7 @@ intel_dp_compute_link_config_wide(struct intel_dp *intel_dp,
intel_dp_output_format_link_bpp_x16(pipe_config->output_format, bpp);

for (i = 0; i < intel_dp_link_caps_num_common_rates(intel_dp->link.caps); i++) {
- link_rate = intel_dp_common_rate(link_caps, i);
+ link_rate = intel_dp_link_caps_common_rate(link_caps, i);
if (link_rate < limits->min_rate ||
link_rate > limits->max_rate)
continue;
@@ -1998,7 +1998,7 @@ static int dsc_compute_link_config(struct intel_dp *intel_dp,
int i;

for (i = 0; i < intel_dp_link_caps_num_common_rates(intel_dp->link.caps); i++) {
- link_rate = intel_dp_common_rate(link_caps, i);
+ link_rate = intel_dp_link_caps_common_rate(link_caps, i);
if (link_rate < limits->min_rate || link_rate > limits->max_rate)
continue;

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 4250cdc7af702..529cb702c99eb 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_caps.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_caps.c
@@ -78,14 +78,14 @@ struct intel_dp_link_caps {
};

/* Get length of common rates array potentially limited by max_rate. */
-static int intel_dp_common_len_rate_limit(struct intel_dp_link_caps *link_caps,
- int max_rate)
+static int intel_dp_link_caps_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);
}

-int intel_dp_common_rate(struct intel_dp_link_caps *link_caps, int index)
+int intel_dp_link_caps_common_rate(struct intel_dp_link_caps *link_caps, int index)
{
struct intel_dp *intel_dp = link_caps->dp;
struct intel_display *display = to_intel_display(intel_dp);
@@ -121,9 +121,9 @@ int intel_dp_link_caps_common_rate_idx(struct intel_dp_link_caps *link_caps, int
}

/* Theoretical max between source and sink */
-int intel_dp_max_common_rate(struct intel_dp_link_caps *link_caps)
+int intel_dp_link_caps_max_common_rate(struct intel_dp_link_caps *link_caps)
{
- return intel_dp_common_rate(link_caps, link_caps->num_rates - 1);
+ return intel_dp_link_caps_common_rate(link_caps, link_caps->num_rates - 1);
}

int intel_dp_link_caps_num_common_rates(struct intel_dp_link_caps *link_caps)
@@ -173,11 +173,11 @@ static int forced_link_rate(struct intel_dp_link_caps *link_caps)
if (!link_caps->forced_params.rate)
return 0;

- len = intel_dp_common_len_rate_limit(link_caps, link_caps->forced_params.rate);
+ len = intel_dp_link_caps_common_len_rate_limit(link_caps, link_caps->forced_params.rate);
if (len == 0)
- return intel_dp_common_rate(link_caps, 0);
+ return intel_dp_link_caps_common_rate(link_caps, 0);

- return intel_dp_common_rate(link_caps, len - 1);
+ return intel_dp_link_caps_common_rate(link_caps, len - 1);
}

void intel_dp_link_caps_get_forced_params(struct intel_dp_link_caps *link_caps,
@@ -190,7 +190,7 @@ void intel_dp_link_caps_get_forced_params(struct intel_dp_link_caps *link_caps,
static int intel_dp_link_config_rate(struct intel_dp_link_caps *link_caps,
const struct intel_dp_link_config_entry *lc)
{
- return intel_dp_common_rate(link_caps, lc->link_rate_idx);
+ return intel_dp_link_caps_common_rate(link_caps, lc->link_rate_idx);
}

static int intel_dp_link_config_lane_count(const struct intel_dp_link_config_entry *lc)
@@ -253,7 +253,7 @@ static void set_max_link_limits_no_update(struct intel_dp_link_caps *link_caps,
static void reset_max_link_limits_no_update(struct intel_dp_link_caps *link_caps)
{
struct intel_dp_link_config max_link_limits = {
- .rate = intel_dp_max_common_rate(link_caps),
+ .rate = intel_dp_link_caps_max_common_rate(link_caps),
.lane_count = intel_dp_link_caps_max_common_lane_count(link_caps),
};

@@ -449,9 +449,9 @@ bool intel_dp_link_caps_update(struct intel_dp_link_caps *link_caps,
link_params_changed = true;

/* TODO: Update these as part of the rest of max param updates. */
- len = intel_dp_common_len_rate_limit(link_caps, link_caps->max_limits.rate);
+ len = intel_dp_link_caps_common_len_rate_limit(link_caps, link_caps->max_limits.rate);
if (len > 0)
- link_caps->max_limits.rate = intel_dp_common_rate(link_caps, len - 1);
+ link_caps->max_limits.rate = intel_dp_link_caps_common_rate(link_caps, len - 1);

if (link_caps->max_limits.rate != old_max_limits.rate)
link_params_changed = true;
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 db17f7ba19954..2afc47c6b7e68 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_caps.h
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_caps.h
@@ -11,9 +11,9 @@ struct intel_dp;
struct intel_dp_link_caps;
struct intel_dp_link_config;

-int intel_dp_common_rate(struct intel_dp_link_caps *link_caps, int index);
+int intel_dp_link_caps_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);
+int intel_dp_link_caps_max_common_rate(struct intel_dp_link_caps *link_caps);
int intel_dp_link_caps_num_common_rates(struct intel_dp_link_caps *link_caps);
void intel_dp_link_caps_all_common_rates(struct intel_dp_link_caps *link_caps,
const int **rates, int *num_rates);
diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
index a89f9161b8329..b7645bcbe0c2b 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
@@ -1812,7 +1812,7 @@ static int reduce_link_rate(struct intel_dp *intel_dp, int current_rate)
if (rate_index <= 0)
return -1;

- new_rate = intel_dp_common_rate(link_caps, rate_index - 1);
+ new_rate = intel_dp_link_caps_common_rate(link_caps, rate_index - 1);

/* TODO: Make switching from UHBR to non-UHBR rates work. */
if (drm_dp_is_uhbr_rate(current_rate) != drm_dp_is_uhbr_rate(new_rate))
@@ -1847,7 +1847,7 @@ static bool reduce_link_params_in_rate_lane_order(struct intel_dp *intel_dp,
link_rate = reduce_link_rate(intel_dp, crtc_state->port_clock);
if (link_rate < 0) {
lane_count = reduce_lane_count(intel_dp, crtc_state->lane_count);
- link_rate = intel_dp_max_common_rate(link_caps);
+ link_rate = intel_dp_link_caps_max_common_rate(link_caps);
}

if (lane_count < 0)
diff --git a/drivers/gpu/drm/i915/display/intel_dp_tunnel.c b/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
index bccd3bfe32a2c..52f5c88f7e09c 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_tunnel.c
@@ -58,7 +58,7 @@ static int kbytes_to_mbits(int kbytes)
static int get_current_link_bw(struct intel_dp *intel_dp)
{
struct intel_dp_link_caps *link_caps = intel_dp->link.caps;
- int rate = intel_dp_max_common_rate(link_caps);
+ int rate = intel_dp_link_caps_max_common_rate(link_caps);
int lane_count = intel_dp_link_caps_max_common_lane_count(link_caps);

return intel_dp_max_link_data_rate(intel_dp, rate, lane_count);
--
2.49.1