drm/vkms: Add vblank events simulated by hrtimers
authorRodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Thu, 12 Jul 2018 02:02:26 +0000 (23:02 -0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 12 Jul 2018 06:48:48 +0000 (08:48 +0200)
commit3a0709928b172a4123a76078f70e0a706265690c
tree25c6b56f32fd82d15a27fe06a7691e450e60a454
parentd16489307a52f028dcb072addf681f9280f585c6
drm/vkms: Add vblank events simulated by hrtimers

This commit adds regular vblank events simulated through hrtimers, which
is a feature required by VKMS to mimic real hardware. Additionally, all
the vblank event send after pageflip is kept in the atomic_flush
function.

Changes since V1:
 - Compute the vblank timer interval per interruption
 Ville Syrjälä and Daniel Vetter:
 - Removes hardcoded vblank interval to get it from user space

Changes since V2:
 Chris Wilson
 - Removes unnecessary algorithm to compute the next period
 Daniel Vetter:
 - Uses drm_calc_timestamping_constants to get the vblank interval
   instead of calculating it manually
 - Adds disable_vblank helper that turns of crtc
 - Simplifies implementation by using drm_crtc_arm_vblank_event
 - Replaces the code in atomic_begin to atomic_flush
 - Removes unnecessary field in vkms_output

Changes since V3:
 Daniel Vetter:
 - Squash "drm/vkms: Add atomic helpers functions" into the commit that
   handling vblank events simulated by hrtimers

Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/7709bba40782ec06332d57fff337797b272581fc.1531359228.git.rodrigosiqueiramelo@gmail.com
drivers/gpu/drm/vkms/vkms_crtc.c
drivers/gpu/drm/vkms/vkms_drv.c
drivers/gpu/drm/vkms/vkms_drv.h