mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: Christian <servidorjarvis1@gmail.com>,
	"Javier Martinez Canillas" <javierm@redhat.com>,
	"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
	"Maxime Ripard" <mripard@kernel.org>,
	"Michel Dänzer" <michel@daenzer.net>
Cc: David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/simpledrm: Use vblank timer
Date: Tue, 17 Nov 2026 14:06:42 +0100	[thread overview]
Message-ID: <065124a2-d042-4b50-b9f1-3f6c648937b5@suse.de> (raw)
In-Reply-To: <CAMas6S3zMKwb5KZ-UNnTd92hZNN0CONY28bROWbojYHBNFCRgg@mail.gmail.com>

(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 <servidorjarvis1@gmail.com>
> ---
>   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)



      reply	other threads:[~2026-11-17 13:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  9:49 Christian
2026-11-17 13:06 ` Thomas Zimmermann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=065124a2-d042-4b50-b9f1-3f6c648937b5@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=javierm@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=michel@daenzer.net \
    --cc=mripard@kernel.org \
    --cc=servidorjarvis1@gmail.com \
    --cc=simona@ffwll.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®