diff options
author | mischief <mischief@offblast.org> | 2014-06-09 00:22:11 -0700 |
---|---|---|
committer | mischief <mischief@offblast.org> | 2014-06-09 00:22:11 -0700 |
commit | ca5cc6519de2b515e64775de4126dae29b3a1bde (patch) | |
tree | 2ff6701be9f76d37d4c5c774815921511e25ddd5 /sys/src/9/pc/screen.c | |
parent | 858d3e39ab7e792c1d6e853ed699aeb5faf7d47c (diff) |
pc: clip rectangles before sending them to the hardware in flushmemscreen
the vmware svga video card emulated by qemu (qemu -vga vmware) complains and eventually causes a panic if the rectangles aren't clipped.
messages like the following can be observed from qemu before the kernel panics:
vmsvga_update_rect: update h was < 0 (-20000)
vmsvga_update_rect: update height too large y: 10000, h: 0
vmsvga_update_rect: update w was < 0 (-20000)
vmsvga_update_rect: update width too large x: 10000, w: 0
i could only reproduce this in qemu 2.0.50 on the master branch, when using the ui and had selected 'Zoom To Fit' from the View menu.
Diffstat (limited to 'sys/src/9/pc/screen.c')
-rw-r--r-- | sys/src/9/pc/screen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/9/pc/screen.c b/sys/src/9/pc/screen.c index da3f2d730..de742cd84 100644 --- a/sys/src/9/pc/screen.c +++ b/sys/src/9/pc/screen.c @@ -179,12 +179,12 @@ flushmemscreen(Rectangle r) scr = &vgascreen[0]; if(scr->gscreen == nil || scr->useflush == 0) return; + if(rectclip(&r, scr->gscreen->r) == 0) + return; if(scr->dev && scr->dev->flush){ scr->dev->flush(scr, r); return; } - if(rectclip(&r, scr->gscreen->r) == 0) - return; disp = scr->vaddr; incs = scr->gscreen->width*sizeof(ulong); off = (r.min.x*scr->gscreen->depth) / 8; |