[Intel-gfx] [PATCH] drm/i915/display: mode clock check related to max dotclk frequency

Nischal Varide nischal.varide at intel.com
Wed Nov 9 04:03:24 UTC 2022


A check on mode->clock to see if is greater than i915->max_dotclk_freq
or greater than 2 * (i915_max_dotclk_freq) in case of big-joiner and
return an -EINVAL in both the cases

Signed-off-by: Nischal Varide <nischal.varide at intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 7400d6b4c587..813f4c369dda 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -995,6 +995,10 @@ intel_dp_mode_valid(struct drm_connector *_connector,
 		bigjoiner = true;
 		max_dotclk *= 2;
 	}
+
+	if (mode->clock > max_dotclk)
+		return -EINVAL;
+
 	if (target_clock > max_dotclk)
 		return MODE_CLOCK_HIGH;
 
-- 
2.36.0



More information about the Intel-gfx mailing list