summaryrefslogtreecommitdiff
path: root/sys/src/cmd/vmx
diff options
context:
space:
mode:
authoraiju <devnull@localhost>2017-06-20 18:20:25 +0000
committeraiju <devnull@localhost>2017-06-20 18:20:25 +0000
commitda6e5efe394ccb8e5edff66f9ec3ac8d9b1ed081 (patch)
tree0a8fcabf4588aa31cf5dd496bf72062ae2616f54 /sys/src/cmd/vmx
parent164588e3e2aca1f6deac1dd4bcf962a0867a26fc (diff)
vmx(1): round up frame buffer size to whole pages, ignore vga access in linear framebuffer, tell openbsd about framebuffer
Diffstat (limited to 'sys/src/cmd/vmx')
-rw-r--r--sys/src/cmd/vmx/ksetup.c29
-rw-r--r--sys/src/cmd/vmx/vga.c5
2 files changed, 34 insertions, 0 deletions
diff --git a/sys/src/cmd/vmx/ksetup.c b/sys/src/cmd/vmx/ksetup.c
index db3cc56d9..f48b4f401 100644
--- a/sys/src/cmd/vmx/ksetup.c
+++ b/sys/src/cmd/vmx/ksetup.c
@@ -555,6 +555,34 @@ obsdend(void)
}
static void
+obsdfb(void)
+{
+ int i, s, p;
+ u32int r, g, b, a, m;
+ extern VgaMode *curmode, textmode;
+ extern uintptr fbaddr, fbsz;
+
+ if(curmode == &textmode) return;
+ p = r = g = b = a = 0;
+ for(i = 0; i < 4; i++){
+ s = curmode->chan >> 8 * i & 0xf;
+ if(s == 0) continue;
+ m = (1<<s)-1 << p;
+ p += s;
+ switch(curmode->chan >> 4 + 8 * i & 0xf){
+ case CRed: r |= m; break;
+ case CGreen: g |= m; break;
+ case CBlue: b |= m; break;
+ case CAlpha: case CIgnore: a |= m; break;
+ default: return;
+ }
+ }
+ obsdstart(BOOTARG_EFIINFO);
+ obsdpack("vvvviiiiiii", 0ULL, 0ULL, (uvlong)fbaddr, (uvlong)fbsz, curmode->h, curmode->w, curmode->w, r, g, b, a);
+ obsdend();
+}
+
+static void
obsdargs(void)
{
Region *r;
@@ -572,6 +600,7 @@ obsdargs(void)
if(obsddbcons != -1){
obsdstart(BOOTARG_DDB); obsdpack("i", obsddbcons); obsdend();
}
+ obsdfb();
obsdstart(BOOTARG_END); obsdend();
}
diff --git a/sys/src/cmd/vmx/vga.c b/sys/src/cmd/vmx/vga.c
index edd141c46..37c533539 100644
--- a/sys/src/cmd/vmx/vga.c
+++ b/sys/src/cmd/vmx/vga.c
@@ -17,6 +17,7 @@ uintptr fbaddr;
VgaMode *curmode, *nextmode, *modes, **modeslast = &modes;
int curhbytes, nexthbytes;
int vesamode, maxw, maxh;
+int novga;
VgaMode textmode = {
.w 640, .h 400, .no 3
@@ -152,6 +153,8 @@ vgaio(int isin, u16int port, u32int val, int sz, void *)
{
u32int m;
+ if(novga)
+ return 0;
if(port == 0x3d4 && sz == 2 && !isin){
vgaio(0, 0x3d4, (u8int)val, 1, nil);
return vgaio(0, 0x3d5, (u8int)(val >> 8), 1, nil);
@@ -691,6 +694,8 @@ vgafbparse(char *fbstring)
if(vesamode == 0){
curmode = modes;
curhbytes = curmode->hbytes;
+ fbsz = -(-fbsz & -4096);
+ novga = 1;
}else{
curmode = &textmode;
if(fbsz < (1<<22))