drm/amd/display: In VRR mode, do DRM core vblank handling at end of vblank. (v2)
authorMario Kleiner <mario.kleiner.de@gmail.com>
Fri, 29 Mar 2019 12:00:56 +0000 (13:00 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 3 Apr 2019 15:00:33 +0000 (10:00 -0500)
commitd2574c33bb719575bac7a7044daed24081601804
treea4cfc9401aee5cff231500ae9eaf0c790f9d9ea6
parentfdd1fe57c00ef96c8a8ab6e5eab03d248deecca6
drm/amd/display: In VRR mode, do DRM core vblank handling at end of vblank. (v2)

In VRR mode, proper vblank/pageflip timestamps can only be computed
after the display scanout position has left front-porch. Therefore
delay calls to drm_crtc_handle_vblank(), and thereby calls to
drm_update_vblank_count() and pageflip event delivery, to after the
end of front-porch when in VRR mode.

We add a new vupdate irq, which triggers at the end of the vupdate
interval, ie. at the end of vblank, and calls the core vblank handler
function. The new irq handler is not executed in standard non-VRR
mode, so vblank handling for fixed refresh rate mode is identical
to the past implementation.

v2: Implement feedback by Nicholas and Paul Menzel.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c
drivers/gpu/drm/amd/display/dc/irq/dce110/irq_service_dce110.c
drivers/gpu/drm/amd/display/dc/irq/dce120/irq_service_dce120.c
drivers/gpu/drm/amd/display/dc/irq/dce80/irq_service_dce80.c
drivers/gpu/drm/amd/display/dc/irq/dcn10/irq_service_dcn10.c