changelog shortlog tags branches changeset files revisions annotate raw help

Mercurial > hg > plan9front / sys/src/9/pc/vgaigfx.c

changeset 4184: 0070b7f7588e
child: 57a248708321
author: cinap_lenrek@felloff.net
date: Fri, 09 Jan 2015 03:03:23 +0100
permissions: -rw-r--r--
description: igfx: aaaand the kernel part :(
1 #include "u.h"
2 #include "../port/lib.h"
3 #include "mem.h"
4 #include "dat.h"
5 #include "fns.h"
6 #include "io.h"
7 #include "../port/error.h"
8 
9 #define Image IMAGE
10 #include <draw.h>
11 #include <memdraw.h>
12 #include <cursor.h>
13 #include "screen.h"
14 
15 static void
16 igfxenable(VGAscr* scr)
17 {
18  Pcidev *p;
19 
20  if(scr->mmio != nil)
21  return;
22  p = scr->pci;
23  if(p == nil)
24  return;
25  scr->mmio = vmap(p->mem[0].bar&~0x0F, p->mem[0].size);
26  if(scr->mmio == nil)
27  return;
28  addvgaseg("igfxmmio", p->mem[0].bar&~0x0F, p->mem[1].size);
29  if(scr->paddr == 0)
30  vgalinearpci(scr);
31  if(scr->apsize)
32  addvgaseg("igfxscreen", scr->paddr, scr->apsize);
33 }
34 
35 VGAdev vgaigfxdev = {
36  "igfx",
37  igfxenable,
38 };