[PATCH] drm/simpledrm: Use vblank timer
From: Christian
Date: Tue Nov 17 2026 - 04:49:32 EST
simpledrm has no vblank interrupt, so DRM_IOCTL_WAIT_VBLANK fails and
Xorg's modesetting driver falls back to a fake vblank of about 1 Hz for
Present. Every client that syncs to vblank on top of it (glxgears, mpv,
Chromium with its default GPU vsync) is paced at roughly one frame a
second.
Use the DRM vblank timer, as bochs and cirrus-qemu do, so vblank events
come at the rate of the display mode (60 Hz for sysfb modes).
Measured on an HP ElitePad 900 G1 (Atom Z2760, simpledrm on the EFI
framebuffer, Xorg modesetting + glamor, kernel 7.3.4): glxgears with
vsync went from 1.4 FPS to 24 FPS; Chromium 150 (ANGLE on GLES)
animating CSS from 1.9 to 13.8 FPS, with the GPU process no longer
idling between frames.
Signed-off-by: Christian <servidorjarvis1@xxxxxxxxx>
---
drivers/gpu/drm/sysfb/simpledrm.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/gpu/drm/sysfb/simpledrm.c
b/drivers/gpu/drm/sysfb/simpledrm.c
index deaeb7d1f..3461a0f98 100644
--- a/drivers/gpu/drm/sysfb/simpledrm.c
+++ b/drivers/gpu/drm/sysfb/simpledrm.c
@@ -31,6 +31,8 @@
#include <drm/drm_of.h>
#include <drm/drm_print.h>
#include <drm/drm_probe_helper.h>
+#include <drm/drm_vblank.h>
+#include <drm/drm_vblank_helper.h>
#include "drm_sysfb_helper.h"
@@ -583,10 +585,12 @@ static const struct drm_plane_funcs
simpledrm_primary_plane_funcs = {
static const struct drm_crtc_helper_funcs simpledrm_crtc_helper_funcs = {
DRM_SYSFB_CRTC_HELPER_FUNCS,
+ DRM_CRTC_HELPER_VBLANK_FUNCS,
};
static const struct drm_crtc_funcs simpledrm_crtc_funcs = {
DRM_SYSFB_CRTC_FUNCS,
+ DRM_CRTC_VBLANK_TIMER_FUNCS,
.destroy = drm_crtc_cleanup,
};
@@ -874,6 +878,10 @@ static struct simpledrm_device
*simpledrm_device_create(struct drm_driver *drv,
if (ret)
return ERR_PTR(ret);
+ ret = drm_vblank_init(dev, 1);
+ if (ret)
+ return ERR_PTR(ret);
+
drm_mode_config_reset(dev);
return sdev;
--
2.47.3