]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/cirrus-qemu: Use vblank timer
authorThomas Zimmermann <tzimmermann@suse.de>
Wed, 8 Oct 2025 12:14:36 +0000 (14:14 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 15 Oct 2025 08:29:49 +0000 (10:29 +0200)
commit42dd66d377ccf7860eeb40b1bded75bf2acdd0a8
tree580cce327fc2299435b20ed65be02e057ee8bf39
parentbde44378397b1969f2be5908f41083e900eb5294
drm/cirrus-qemu: Use vblank timer

Use a vblank timer to simulate the vblank interrupt. The DRM vblank
helpers provide an implementation on top of Linux' hrtimer. Cirrus-qemu
enables and disables the timer as part of the CRTC. The atomic_flush
callback sets up the event. Like vblank interrupts, the vblank timer
fires at the rate of the display refresh.

Most userspace limits its page flip rate according to the DRM vblank
event. Cirrus-qemu' virtual hardware does not provide vblank interrupts,
so DRM sends each event ASAP. With the fast access times of virtual display
memory, the event rate is much higher than the display mode's refresh
rate; creating the next page flip almost immediately. This leads to
excessive CPU overhead from even small display updates, such as moving
the mouse pointer.

This problem affects cirrus-qemu and all other virtual displays. See [1]
for a discussion in the context of hypervdrm.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://lore.kernel.org/dri-devel/SN6PR02MB415702B00D6D52B0EE962C98D46CA@SN6PR02MB4157.namprd02.prod.outlook.com/
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Link: https://lore.kernel.org/r/20251008121450.227997-1-tzimmermann@suse.de
drivers/gpu/drm/tiny/cirrus-qemu.c