summaryrefslogtreecommitdiff
path: root/fb.c
diff options
context:
space:
mode:
authorrodri <rgl@antares-labs.eu>2024-05-23 21:08:55 +0000
committerrodri <rgl@antares-labs.eu>2024-05-23 21:08:55 +0000
commit7739f20ce8608c0613552e430f31008705050bf1 (patch)
treecb636ae88fa0fe9fedabcb841215d597838de3e7 /fb.c
parente2e203e6fa64a9e57c8d4ba4cea4deec89d8f0c1 (diff)
downloadlibgraphics-7739f20ce8608c0613552e430f31008705050bf1.tar.gz
libgraphics-7739f20ce8608c0613552e430f31008705050bf1.tar.bz2
libgraphics-7739f20ce8608c0613552e430f31008705050bf1.zip
replace the Framebufctl's Lock with a QLock.
this provides fair scheduling, minimizing contention.
Diffstat (limited to 'fb.c')
-rw-r--r--fb.c12
1 files changed, 6 insertions, 6 deletions
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