shithub: riscv

Download patch

ref: 21669c4c9734c948eb3be971db7a345b5349469a
parent: 52a3502927870a330f02a9b71cf9710f65f1a58a
author: aiju <devnull@localhost>
date: Sat Jun 17 18:52:13 EDT 2017

vmx(1): fix non-vesa framebuffer mode

--- a/sys/src/cmd/vmx/vga.c
+++ b/sys/src/cmd/vmx/vga.c
@@ -557,9 +557,9 @@
 
 	threadsetname("draw");
 	sfb = emalloc(fbsz);
+	event = 4;
 	for(;; sleep(20)){
 		qlock(&vga);
-		event = 0;
 		m = nextmode;
 		if(m != curmode){
 			event |= 1;
@@ -572,7 +572,7 @@
 		}
 		while(nbrecv(mc->resizec, &ul) > 0)
 			event |= 2;
-		if(event != 0){
+		if((event & 3) != 0){
 			if((event & 2) != 0 && getwindow(display, Refnone) < 0)
 				sysfatal("resize failed: %r");
 			screeninit((event & 2) != 0);
@@ -581,6 +581,7 @@
 			drawtext();
 		else
 			drawfb(event != 0);
+		event = 0;
 		qunlock(&vga);
 	}
 }
@@ -704,6 +705,7 @@
 
 	if(curmode == nil) return;
 	nextmode = curmode;
+	nexthbytes = curhbytes;
 	tfb = gptr(0xb8000, 0x8000);
 	if(tfb == nil)
 		sysfatal("got nil ptr for text framebuffer");