mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/i915/dp_link_caps: Validate max link rate
@ 2026-08-27  2:20 tarund18303
  2026-09-09 12:16 ` Jani Nikula
  0 siblings, 1 reply; 2+ messages in thread
From: tarund18303 @ 2026-08-27  2:20 UTC (permalink / raw)
  To: jani.nikula
  Cc: rodrigo.vivi, joonas.lahtinen, tursulin, airlied, simona,
	intel-gfx, intel-xe, dri-devel, linux-kernel, tarun-tarun143

From: tarun-tarun143 <tarund18303@gmail.com>

Validate the maximum link rate against the source-supported rates
before using the maximum link limits to calculate allowed
configurations.

This prevents an unsupported link rate from being accepted as a
maximum link limit.

Signed-off-by: tarun-tarun143 <tarund18303@gmail.com>
---
 drivers/gpu/drm/i915/display/intel_dp_link_caps.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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 7b6cc6055da8..0934488153bb 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_caps.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_caps.c
@@ -710,7 +710,10 @@ static bool max_link_limits_valid(struct intel_dp_link_caps *link_caps,
 	    !is_power_of_2(max_link_limits->lane_count))
 		return false;
 
-	/* TODO: Validate max_link_limits->rate against the source supported rates. */
+	if (intel_dp_rate_index(link_caps->dp->source_rates,
+				link_caps->dp->num_source_rates,
+				max_link_limits->rate) < 0)
+		return false;
 
 	intel_dp_link_caps_get_forced_params(link_caps, &forced_params);
 	allowed_configs = calc_allowed_config_filter(link_caps, link_caps->enabled_configs,

base-commit: 73e3f0710014fe6d4ed98cfc02292f6121db7558
-- 
2.43.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] drm/i915/dp_link_caps: Validate max link rate
  2026-08-27  2:20 [PATCH] drm/i915/dp_link_caps: Validate max link rate tarund18303
@ 2026-09-09 12:16 ` Jani Nikula
  0 siblings, 0 replies; 2+ messages in thread
From: Jani Nikula @ 2026-09-09 12:16 UTC (permalink / raw)
  To: tarund18303
  Cc: rodrigo.vivi, joonas.lahtinen, tursulin, airlied, simona,
	intel-gfx, intel-xe, dri-devel, linux-kernel, tarun-tarun143

On Thu, 27 Aug 2026, tarund18303@gmail.com wrote:
> From: tarun-tarun143 <tarund18303@gmail.com>
>
> Validate the maximum link rate against the source-supported rates
> before using the maximum link limits to calculate allowed
> configurations.
>
> This prevents an unsupported link rate from being accepted as a
> maximum link limit.

Are you seeing this issue being hit, or are you just going through TODO
comments and trying to come up with fixes?

BR,
Jani.

>
> Signed-off-by: tarun-tarun143 <tarund18303@gmail.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp_link_caps.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> 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 7b6cc6055da8..0934488153bb 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_link_caps.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_link_caps.c
> @@ -710,7 +710,10 @@ static bool max_link_limits_valid(struct intel_dp_link_caps *link_caps,
>  	    !is_power_of_2(max_link_limits->lane_count))
>  		return false;
>  
> -	/* TODO: Validate max_link_limits->rate against the source supported rates. */
> +	if (intel_dp_rate_index(link_caps->dp->source_rates,
> +				link_caps->dp->num_source_rates,
> +				max_link_limits->rate) < 0)
> +		return false;
>  
>  	intel_dp_link_caps_get_forced_params(link_caps, &forced_params);
>  	allowed_configs = calc_allowed_config_filter(link_caps, link_caps->enabled_configs,
>
> base-commit: 73e3f0710014fe6d4ed98cfc02292f6121db7558

-- 
Jani Nikula, Intel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-09 12:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-27  2:20 [PATCH] drm/i915/dp_link_caps: Validate max link rate tarund18303
2026-09-09 12:16 ` Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®