(cc Michel) Hi
Am 17.11.26 um 10:49 schrieb Christian:
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).
We have been discussing general vblank support before; so far with no clear results. Originally the WAIT_VBLANK ioctl and similar functionality is meant to return real hardware values. Using vblank timers for virtual hardware is already a huge exception. That is still the status quo AFAIU.
Why can this problem not be fixed in Xorg? Best regards Thomas
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 <[email protected]> --- 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;
-- -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Frankenstr. 146, 90461 Nürnberg, Germany, www.suse.com GF: Stefan Gaiser, Jochen Jaser, Abhinav Puri, (HRB 36809, AG Nürnberg)
