]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/i915/dp: Early reject bad hdisplay in intel_dp_mode_valid
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Mon, 2 Feb 2026 10:37:15 +0000 (16:07 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Tue, 3 Feb 2026 08:17:00 +0000 (13:47 +0530)
Move check for bad hdisplay early as it is independent on other checks.

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patch.msgid.link/20260202103731.357416-2-ankit.k.nautiyal@intel.com
drivers/gpu/drm/i915/display/intel_dp.c

index 380d9801c377e12039d34de9dadf1b8ceda75df6..fe9f8392ca8fe531bb86fa53829abccc980510d9 100644 (file)
@@ -1460,6 +1460,9 @@ intel_dp_mode_valid(struct drm_connector *_connector,
        if (mode->clock < 10000)
                return MODE_CLOCK_LOW;
 
+       if (intel_dp_hdisplay_bad(display, mode->hdisplay))
+               return MODE_H_ILLEGAL;
+
        fixed_mode = intel_panel_fixed_mode(connector, mode);
        if (intel_dp_is_edp(intel_dp) && fixed_mode) {
                status = intel_panel_mode_valid(connector, mode);
@@ -1483,9 +1486,6 @@ intel_dp_mode_valid(struct drm_connector *_connector,
        if (target_clock > max_dotclk)
                return MODE_CLOCK_HIGH;
 
-       if (intel_dp_hdisplay_bad(display, mode->hdisplay))
-               return MODE_H_ILLEGAL;
-
        max_link_clock = intel_dp_max_link_rate(intel_dp);
        max_lanes = intel_dp_max_lane_count(intel_dp);