diff options
author | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-07-18 10:16:00 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@gmx.de> | 2012-07-18 10:16:00 +0200 |
commit | b9ca8e83784b94e709e7d412eb4f87fa0a1885a8 (patch) | |
tree | e941217032e777d7ec33805930924d7fdd265aec /sys/src/9/pc/vgavesa.c | |
parent | 5654f15e56087986812c557412d558482383fc8b (diff) |
vga: softscreen
allow the shadow framebuffer (softscreen) to be used with any
vga driver, not just vesa. this removes the ugly scr->paddr = 0
hack employed by vesa driver to force softscreen and adds a
softscreen vgactl message that can switch the feature on and off
at runtime.
softscreen can greatly improve graphics performance when bus
reads are slow even tho it disables hardware acceleration.
Diffstat (limited to 'sys/src/9/pc/vgavesa.c')
-rw-r--r-- | sys/src/9/pc/vgavesa.c | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/sys/src/9/pc/vgavesa.c b/sys/src/9/pc/vgavesa.c index 3e7546801..98cd84dde 100644 --- a/sys/src/9/pc/vgavesa.c +++ b/sys/src/9/pc/vgavesa.c @@ -24,7 +24,6 @@ enum { RealModeBuf = 0x9000, }; -static void *hardscreen; static uchar modebuf[0x1000]; static Chan *creg, *cmem; static QLock vesaq; @@ -108,12 +107,6 @@ vesalinear(VGAscr *scr, int, int) Pcidev *pci; uchar *p; - if(hardscreen) { - scr->vaddr = hardscreen; - scr->paddr = scr->apsize = 0; - return; - } - vbecheck(); mode = vbegetmode(); /* @@ -163,38 +156,8 @@ vesalinear(VGAscr *scr, int, int) vgalinearaddr(scr, paddr, size); if(scr->apsize) addvgaseg("vesascreen", scr->paddr, scr->apsize); - if(getconf("*novesashadow")) - return; - hardscreen = scr->vaddr; - scr->paddr = scr->apsize = 0; -} -static void -vesaflush(VGAscr *scr, Rectangle r) -{ - int t, w, wid, off; - ulong *hp, *sp, *esp; - - if(hardscreen == nil) - return; - if(rectclip(&r, scr->gscreen->r) == 0) - return; - sp = (ulong*)(scr->gscreendata->bdata + scr->gscreen->zero); - t = (r.max.x * scr->gscreen->depth + 2*BI2WD-1) / BI2WD; - w = (r.min.x * scr->gscreen->depth) / BI2WD; - w = (t - w) * BY2WD; - wid = scr->gscreen->width; - off = r.min.y * wid + (r.min.x * scr->gscreen->depth) / BI2WD; - - hp = hardscreen; - hp += off; - sp += off; - esp = sp + Dy(r) * wid; - while(sp < esp){ - memmove(hp, sp, w); - hp += wid; - sp += wid; - } + scr->softscreen = 1; } static int @@ -285,8 +248,4 @@ VGAdev vgavesadev = { 0, vesalinear, vesadrawinit, - 0, - 0, - 0, - vesaflush, }; |