From efc85c10f5c211e9dcbb74d228560ef80b29fab6 Mon Sep 17 00:00:00 2001 From: Ankit Nautiyal Date: Mon, 2 Feb 2026 16:07:15 +0530 Subject: [PATCH] drm/i915/dp: Early reject bad hdisplay in intel_dp_mode_valid Move check for bad hdisplay early as it is independent on other checks. Signed-off-by: Ankit Nautiyal Reviewed-by: Imre Deak Link: https://patch.msgid.link/20260202103731.357416-2-ankit.k.nautiyal@intel.com --- drivers/gpu/drm/i915/display/intel_dp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 380d9801c377..fe9f8392ca8f 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -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);