diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-01-02 17:07:47 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-01-02 17:07:47 +0100 |
commit | 6cb93914f2b955209aabd63c44cecac36aaca6c6 (patch) | |
tree | 272b800ed5b21c45a174d6909a1298cee0ff557f /sys/src/9/pc/devvga.c | |
parent | 9aec87c46c483ca1cf560e0e8a929cdf72447371 (diff) |
devvga: better way to prevent blank hwaccel race
don't hold drawlock duing vga enable and disable, but just zero
the function pointers under drawlock *before* disabling the vga
device.
holding the drawlock while calling out into enable and disable
is not a good idea. with vgavesa, this might deadlock when
userspace realemu tries to print in a rio window with vgavesa.
Diffstat (limited to 'sys/src/9/pc/devvga.c')
-rw-r--r-- | sys/src/9/pc/devvga.c | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/sys/src/9/pc/devvga.c b/sys/src/9/pc/devvga.c index 5d2ec72c8..5120f5946 100644 --- a/sys/src/9/pc/devvga.c +++ b/sys/src/9/pc/devvga.c @@ -309,23 +309,18 @@ vgactl(Cmdbuf *cb) for(i = 0; vgadev[i]; i++){ if(strcmp(cb->f[1], vgadev[i]->name)) continue; - qlock(&drawlock); - if(waserror()){ - qunlock(&drawlock); - nexterror(); - } if(scr->dev){ - if(scr->dev->disable) - scr->dev->disable(scr); + qlock(&drawlock); scr->fill = nil; scr->scroll = nil; scr->blank = nil; + qunlock(&drawlock); + if(scr->dev->disable) + scr->dev->disable(scr); } scr->dev = vgadev[i]; if(scr->dev->enable) scr->dev->enable(scr); - qunlock(&drawlock); - poperror(); return; } break; |