]> Gentwo Git Trees - linux/.git/commit
drm/bochs: Use vblank timer
authorThomas Zimmermann <tzimmermann@suse.de>
Wed, 8 Oct 2025 09:36:55 +0000 (11:36 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Wed, 15 Oct 2025 08:29:39 +0000 (10:29 +0200)
commitbde44378397b1969f2be5908f41083e900eb5294
tree7d3b60db360364925761397508eb9cb31c1fa7f8
parentb245bc23ff5840f1f0d54d2d76ff5facc03a51bb
drm/bochs: Use vblank timer

Use a vblank timer to simulate the vblank interrupt. The DRM vblank
helpers provide an implementation on top of Linux' hrtimer. Bochs
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. Bochs' virtual hardware does not provide vblank interrupts, so
DRM sends each event ASAP. With the fast access time 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 bochs 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/20251008093931.19138-1-tzimmermann@suse.de
drivers/gpu/drm/tiny/bochs.c