drm/i915: Do vblank evasion correctly if vrr push has already been sent
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 17 Nov 2021 18:31:02 +0000 (20:31 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 18 Nov 2021 20:31:15 +0000 (22:31 +0200)
commit0088d39b6ad9f7d814c10e7188aba0ddbc737883
tree6a7e78e7613a34210f2e1ad3ecaf6bc5e5c7aed0
parent4765d061d50559ce3addc9a86433c35f48d76085
drm/i915: Do vblank evasion correctly if vrr push has already been sent

Let's adjust the vblank evasion to account for the case where
a push has already been sent. In that case the vblank exit will start
at vmin vblank start (as opposed to vmax vblank start when no push
has been sent).

This should minimize the effects of the tiny race between sampling
the frame counter vs. intel_vrr_send_push() during the previous frame.
This will also be required if we want to do mailbox style updates with
vrr since then we'd definitely do multiple commits per frame. Currently
mailbox updates are only used by the legacy cursor, but we don't do
vrr push for those.

Cc: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211117183103.27418-2-ville.syrjala@linux.intel.com
Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>
drivers/gpu/drm/i915/display/intel_crtc.c
drivers/gpu/drm/i915/display/intel_vrr.c
drivers/gpu/drm/i915/display/intel_vrr.h