From b9ca8e83784b94e709e7d412eb4f87fa0a1885a8 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Wed, 18 Jul 2012 10:16:00 +0200 Subject: 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. --- sys/src/9/pc/vgavesa.c | 43 +------------------------------------------ 1 file changed, 1 insertion(+), 42 deletions(-) (limited to 'sys/src/9/pc/vgavesa.c') 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, }; -- cgit v1.2.3