igfx: aaaand the kernel part :(
This commit is contained in:
parent
ce8db466ba
commit
35ad5c9136
1 changed files with 38 additions and 0 deletions
38
sys/src/9/pc/vgaigfx.c
Normal file
38
sys/src/9/pc/vgaigfx.c
Normal file
|
@ -0,0 +1,38 @@
|
|||
#include "u.h"
|
||||
#include "../port/lib.h"
|
||||
#include "mem.h"
|
||||
#include "dat.h"
|
||||
#include "fns.h"
|
||||
#include "io.h"
|
||||
#include "../port/error.h"
|
||||
|
||||
#define Image IMAGE
|
||||
#include <draw.h>
|
||||
#include <memdraw.h>
|
||||
#include <cursor.h>
|
||||
#include "screen.h"
|
||||
|
||||
static void
|
||||
igfxenable(VGAscr* scr)
|
||||
{
|
||||
Pcidev *p;
|
||||
|
||||
if(scr->mmio != nil)
|
||||
return;
|
||||
p = scr->pci;
|
||||
if(p == nil)
|
||||
return;
|
||||
scr->mmio = vmap(p->mem[0].bar&~0x0F, p->mem[0].size);
|
||||
if(scr->mmio == nil)
|
||||
return;
|
||||
addvgaseg("igfxmmio", p->mem[0].bar&~0x0F, p->mem[1].size);
|
||||
if(scr->paddr == 0)
|
||||
vgalinearpci(scr);
|
||||
if(scr->apsize)
|
||||
addvgaseg("igfxscreen", scr->paddr, scr->apsize);
|
||||
}
|
||||
|
||||
VGAdev vgaigfxdev = {
|
||||
"igfx",
|
||||
igfxenable,
|
||||
};
|
Loading…
Reference in a new issue