OSDN Git Service

drm/amd/display: Prevent vblank irq disable while VRR is active. (v3)
authorMario Kleiner <mario.kleiner.de@gmail.com>
Fri, 29 Mar 2019 12:00:54 +0000 (13:00 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 3 Apr 2019 15:00:32 +0000 (10:00 -0500)
commit66b0c973d7f74e3f45dbe9904ad02298d1dc430f
tree185ddc3fde1f8ed7e5d07d57f4bc45ba57963d78
parente854194c8b6e27b970f3f993909451d9cc26a21e
drm/amd/display: Prevent vblank irq disable while VRR is active. (v3)

During VRR mode we can not allow vblank irq dis-/enable
transitions, as an enable after a disable can happen at
an arbitrary time during the video refresh cycle, e.g.,
with a high likelyhood inside vblank front-porch. An
enable during front-porch would cause vblank timestamp
updates/calculations which are completely bogus, given
the code can't know when the vblank will end as long
as we are in front-porch with no page flip completed.

Hold a permanent vblank reference on the crtc while
in active VRR mode to prevent a vblank disable, and
drop the reference again when switching back to fixed
refresh rate non-VRR mode.

v2: Make sure transition is also handled if vrr is
    disabled and stream gets disabled in the same
    atomic commit by moving the call to the transition
    function outside of plane commit.
    Suggested by Nicholas.

v3: Trivial rebase onto previous patch.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c