changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: igfx: aaaand the kernel part :(

changeset 4184: 0070b7f7588e
parent 4183: 1f534b6b703b
child 4185: 3c381fe21634
author: cinap_lenrek@felloff.net
date: Fri, 09 Jan 2015 03:03:23 +0100
files: sys/src/9/pc/vgaigfx.c
description: igfx: aaaand the kernel part :(
     1.1new file mode 100644
     1.2--- /dev/null
     1.3+++ b/sys/src/9/pc/vgaigfx.c
     1.4@@ -0,0 +1,38 @@
     1.5+#include "u.h"
     1.6+#include "../port/lib.h"
     1.7+#include "mem.h"
     1.8+#include "dat.h"
     1.9+#include "fns.h"
    1.10+#include "io.h"
    1.11+#include "../port/error.h"
    1.12+
    1.13+#define	Image	IMAGE
    1.14+#include <draw.h>
    1.15+#include <memdraw.h>
    1.16+#include <cursor.h>
    1.17+#include "screen.h"
    1.18+
    1.19+static void
    1.20+igfxenable(VGAscr* scr)
    1.21+{
    1.22+	Pcidev *p;
    1.23+	
    1.24+	if(scr->mmio != nil)
    1.25+		return;
    1.26+	p = scr->pci;
    1.27+	if(p == nil)
    1.28+		return;
    1.29+	scr->mmio = vmap(p->mem[0].bar&~0x0F, p->mem[0].size);
    1.30+	if(scr->mmio == nil)
    1.31+		return;
    1.32+	addvgaseg("igfxmmio", p->mem[0].bar&~0x0F, p->mem[1].size);
    1.33+	if(scr->paddr == 0)
    1.34+		vgalinearpci(scr);
    1.35+	if(scr->apsize)
    1.36+		addvgaseg("igfxscreen", scr->paddr, scr->apsize);
    1.37+}
    1.38+
    1.39+VGAdev vgaigfxdev = {
    1.40+	"igfx",
    1.41+	igfxenable,
    1.42+};