All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/vrr: require valid min/max vfreq for VRR
@ 2026-06-25 13:10 Jani Nikula
  2026-06-25 13:21 ` ✗ CI.checkpatch: warning for " Patchwork
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Jani Nikula @ 2026-06-25 13:10 UTC (permalink / raw)
  To: intel-gfx, intel-xe; +Cc: jani.nikula, Martin Hodo, stable, Ankit Nautiyal

Ensure the EDID provided min/max vfreq are valid. Most scenarios are
already covered (by coincidence) through the checks in
intel_vrr_is_capable() and intel_vrr_is_in_range(), but be more explicit
about it. At worst, a zero min_vfreq could lead to a division by zero in
intel_vrr_compute_vmax().

Discovered using AI-assisted static analysis confirmed by Intel Product
Security.

Reported-by: Martin Hodo <martin.hodo@intel.com>
Fixes: 117cd09ba528 ("drm/i915/display/dp: Compute VRR state in atomic_check")
Cc: <stable@vger.kernel.org> # v5.12+
Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
 drivers/gpu/drm/i915/display/intel_vrr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_vrr.c b/drivers/gpu/drm/i915/display/intel_vrr.c
index 5d9b11185296..bffbdee76ee1 100644
--- a/drivers/gpu/drm/i915/display/intel_vrr.c
+++ b/drivers/gpu/drm/i915/display/intel_vrr.c
@@ -76,6 +76,10 @@ bool intel_vrr_is_capable(struct intel_connector *connector)
 		return false;
 	}
 
+	if (!info->monitor_range.min_vfreq || !info->monitor_range.max_vfreq ||
+	    info->monitor_range.min_vfreq > info->monitor_range.max_vfreq)
+		return false;
+
 	return info->monitor_range.max_vfreq - info->monitor_range.min_vfreq > 10;
 }
 
-- 
2.47.3


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

end of thread, other threads:[~2026-06-26 14:05 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-25 13:10 [PATCH] drm/i915/vrr: require valid min/max vfreq for VRR Jani Nikula
2026-06-25 13:21 ` ✗ CI.checkpatch: warning for " Patchwork
2026-06-25 13:22 ` ✓ CI.KUnit: success " Patchwork
2026-06-25 13:59 ` ✗ Xe.CI.BAT: failure " Patchwork
2026-06-25 15:28 ` ✓ i915.CI.BAT: success " Patchwork
2026-06-26  5:12 ` [PATCH] " Nautiyal, Ankit K
2026-06-26 13:40 ` Ville Syrjälä
2026-06-26 14:05   ` Jani Nikula

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.