From 594ec30073c1ef99a1bd8a20e59b0e10ac9549bb Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Fri, 20 Feb 2015 17:09:59 +0100 Subject: bgi: make FBIO_WAITFORVSYNC really synchronous Signed-off-by: Lucas Stach --- src/bgi.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/bgi.c b/src/bgi.c index e8a8a79..b0ed349 100644 --- a/src/bgi.c +++ b/src/bgi.c @@ -75,6 +75,14 @@ static void fbdev_write(fuse_req_t req, const char *buf, size_t size, fb->pos += size; } +static int wait_vblank_sync(struct kms_fb *fb) +{ + union drm_wait_vblank vblank = {}; + vblank.request.type = _DRM_VBLANK_RELATIVE; + vblank.request.sequence = 1; + return ioctl(drmfd, DRM_IOCTL_WAIT_VBLANK, &vblank); +} + static int wait_vblank(struct kms_fb *fb) { char buffer[1024]; @@ -319,7 +327,7 @@ static void fbdev_ioctl(fuse_req_t req, int cmd, void *arg, break; case FBIO_WAITFORVSYNC: if (fb->vsync.e != NEVER) - wait_vblank(fb); + wait_vblank_sync(fb); fuse_reply_ioctl(req, 0, NULL, 0); break; case FBIOGET_FSCREENINFO: -- cgit v1.2.3