]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/i915/display: Add vblank_start adjustment logic for always-on VRR TG
authorAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Thu, 16 Oct 2025 05:54:13 +0000 (11:24 +0530)
committerAnkit Nautiyal <ankit.k.nautiyal@intel.com>
Thu, 16 Oct 2025 13:57:41 +0000 (19:27 +0530)
commit5cb2cf6aa8d6647bb41ea8c90498e10d192411c8
treec87b984cdf3c00628dc7f4bbc9cc23b43cdfc68f
parent8c0cf4fe9bb3b9d1b76a4dc6e9708a611a2e8f6c
drm/i915/display: Add vblank_start adjustment logic for always-on VRR TG

As we move towards using a shorter, optimized guardband, we need to adjust
how the delayed vblank start is computed.

Adjust the crtc_vblank_start using Vmin Vtotal - guardband only when
intel_vrr_always_use_vrr_tg() is true. Also update the
pipe_mode->crtc_vblank_start which is derived from
adjusted_mode->crtc_vblank_start in intel_crtc_compute_pipe_mode().

To maintain consistency between the computed and readout paths, update
the readout logic in intel_vrr_get_config() to overwrite crtc_vblank_start
with the same value (vtotal - guardband) on platforms with always-on
VRR TG.

This also paves way for guardband optimization, by handling the movement of
the crtc_vblank_start for platforms that have VRR TG always active.

v2: Drop the helper and add the adjustment directly to
    intel_vrr_compute_guardband(). (Ville)
v3: Use adjusted_mode.crtc_vtotal instead of vmin and include the readout
    logic to keep the compute and readout paths in sync. (Ville)
v4: Also set pipe_mode->crtc_vblank_start as its derived from
    adjusted_mode. (Ville)
v5: Add a comment about rationale behind updating
    pipe_mode->crtc_vblank_start. (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/20251016055415.2101347-10-ankit.k.nautiyal@intel.com
drivers/gpu/drm/i915/display/intel_vrr.c