]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/intel_sdvo: Check fixed_mode->clock against max_dotclock in mode_valid
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Thu, 30 Apr 2026 13:12:16 +0000 (18:42 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Mon, 11 May 2026 04:20:53 +0000 (09:50 +0530)
For LVDS SDVO, mode validation checks the requested mode against the
pipe max dotclock, but does not validate the selected fixed mode clock.

After intel_panel_mode_valid(), get the fixed mode and validate its
clock against the max dotclock.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>
Link: https://patch.msgid.link/20260430131220.3891497-2-ankit.k.nautiyal@intel.com
drivers/gpu/drm/i915/display/intel_sdvo.c

index 2e1af9e869ded3f50437cb77cb42ce5c4324174c..e7aaa5b203fd4bd9da1007562dd5a64d2e646a4b 100644 (file)
@@ -1967,10 +1967,16 @@ intel_sdvo_mode_valid(struct drm_connector *connector,
 
        if (IS_LVDS(intel_sdvo_connector)) {
                enum drm_mode_status status;
+               const struct drm_display_mode *fixed_mode;
 
                status = intel_panel_mode_valid(&intel_sdvo_connector->base, mode);
                if (status != MODE_OK)
                        return status;
+
+               fixed_mode = intel_panel_fixed_mode(&intel_sdvo_connector->base, mode);
+
+               if (fixed_mode && fixed_mode->clock > max_dotclk)
+                       return MODE_CLOCK_HIGH;
        }
 
        return MODE_OK;