shithub: riscv

Download patch

ref: 35ad5c91361681246105801d42b5e97c59d0d28c
parent: ce8db466ba402ddb877495f66a7bddf156569fdf
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Thu Jan 8 22:03:23 EST 2015

igfx: aaaand the kernel part :(

--- /dev/null
+++ b/sys/src/9/pc/vgaigfx.c
@@ -1,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,
+};