Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915/vrr: Use fixed timings for platforms that support VRR

For fixed refresh rate use fixed timings for all platforms that support
VRR. For this add checks to avoid computing and reading VRR for
platforms that do not support VRR.

v2: Avoid touching check for VRR_CTL_FLIP_LINE_EN. (Ville)
v3: Avoid redundant statements in vrr_{compute/get}_config. (Ville)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://lore.kernel.org/r/20250324133248.4071909-10-ankit.k.nautiyal@intel.com

+4 -4
+4 -4
drivers/gpu/drm/i915/display/intel_vrr.c
··· 353 353 struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; 354 354 int vmin, vmax; 355 355 356 + if (!HAS_VRR(display)) 357 + return; 358 + 356 359 /* 357 360 * FIXME all joined pipes share the same transcoder. 358 361 * Need to account for that during VRR toggle/push/etc. ··· 379 376 vmax = vmin; 380 377 } 381 378 382 - if (vmin >= vmax) 383 - return; 384 - 385 379 crtc_state->vrr.vmin = vmin; 386 380 crtc_state->vrr.vmax = vmax; 387 381 388 382 crtc_state->vrr.flipline = crtc_state->vrr.vmin; 389 383 390 - if (crtc_state->uapi.vrr_enabled) 384 + if (crtc_state->uapi.vrr_enabled && vmin < vmax) 391 385 intel_vrr_compute_vrr_timings(crtc_state); 392 386 else if (is_cmrr_frac_required(crtc_state) && is_edp) 393 387 intel_vrr_compute_cmrr_timings(crtc_state);