evdi icon indicating copy to clipboard operation
evdi copied to clipboard

drm: implement hrtimer-based vblank for proper frame pacing

Open IraSkyx opened this issue 8 months ago • 0 comments

Fixes #512, partially addresses #511.

enable_vblank returns 1 so drm_atomic_helper_wait_for_vblanks skips the CRTC on every commit. No frame pacing, tearing on compositors that rely on it. The painter-based event path (evdi_painter_set_vblank) doesn't help either: when commits outpace grabpix, the previous event gets flushed during the current atomic flush.

This adds an hrtimer driving drm_crtc_handle_vblank at the mode's refresh rate and switches to drm_crtc_arm_vblank_event in the atomic flush, same pattern as vkms. UPDATE_READY is unchanged.

Tested on Hyprland, 1080p@60Hz DisplayLink. No more tearing, properly paced.

IraSkyx avatar Mar 21 '26 16:03 IraSkyx