From bb11bb1c1f18660c29d5bc46e8de049fd03ff2a0 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 7 Jul 2013 21:02:46 +0200 Subject: vesa: fix blank/unblank wakeups it could happen that we unblanked while vesaproc was currently blanking (when manually blanking using vgactl for example). the wakeup of the unblank is lost. --- sys/src/9/pc/vgavesa.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/sys/src/9/pc/vgavesa.c b/sys/src/9/pc/vgavesa.c index fbe051f5f..b2748b4af 100644 --- a/sys/src/9/pc/vgavesa.c +++ b/sys/src/9/pc/vgavesa.c @@ -163,22 +163,25 @@ vesalinear(VGAscr *scr, int, int) } static int -vesadisabled(void *) +gotctl(void *arg) { - return vesactl == Cdisable; + return vesactl != *((int*)arg); } static void vesaproc(void*) { Ureg u; + int ctl; - while(vesactl != Cdisable){ + ctl = Cenable; + while(ctl != Cdisable){ if(!waserror()){ - sleep(&vesar, vesadisabled, nil); + sleep(&vesar, gotctl, &ctl); + ctl = vesactl; vbesetup(&u, 0x4f10); - if(vesactl == Cblank) + if(ctl == Cblank) u.bx = 0x0101; else u.bx = 0x0001; -- cgit v1.2.3