From 7739f20ce8608c0613552e430f31008705050bf1 Mon Sep 17 00:00:00 2001 From: rodri Date: Thu, 23 May 2024 21:08:55 +0000 Subject: replace the Framebufctl's Lock with a QLock. this provides fair scheduling, minimizing contention. --- fb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'fb.c') diff --git a/fb.c b/fb.c index d7a896b..6037f5a 100644 --- a/fb.c +++ b/fb.c @@ -13,10 +13,10 @@ framebufctl_draw(Framebufctl *ctl, Image *dst) { Framebuf *fb; - lock(ctl); + qlock(ctl); fb = ctl->getfb(ctl); loadimage(dst, rectaddpt(fb->r, dst->r.min), byteaddr(fb->cb, fb->r.min), bytesperline(fb->r, fb->cb->depth)*Dy(fb->r)); - unlock(ctl); + qunlock(ctl); } static void @@ -24,18 +24,18 @@ framebufctl_memdraw(Framebufctl *ctl, Memimage *dst) { Framebuf *fb; - lock(ctl); + qlock(ctl); fb = ctl->getfb(ctl); memimagedraw(dst, dst->r, fb->cb, ZP, nil, ZP, SoverD); - unlock(ctl); + qunlock(ctl); } static void framebufctl_swap(Framebufctl *ctl) { - lock(ctl); + qlock(ctl); ctl->idx ^= 1; - unlock(ctl); + qunlock(ctl); } static void -- cgit v1.2.3