Subject: xsrc/13546: Add i815 support to XF86_SVGA (3.3.6)
To: None <gnats-bugs@gnats.netbsd.org>
From: Manuel Bouyer <bouyer@rp.lip6.fr>
List: netbsd-bugs
Date: 07/24/2001 15:13:18
>Number:         13546
>Category:       xsrc
>Synopsis:       Add i815 support to XF86_SVGA (3.3.6)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    xsrc-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 24 06:10:02 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     
>Release:        NetBSD 1.5.1
>Organization:

LIP6, Universite Paris VI.

>Environment:

System: NetBSD  1.5.1 NetBSD 1.5.1 (GENERIC) #56: Mon Jul  2 15:54:23 CEST 2001     he@nsa.uninett.no:/usr/src/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
	the i815 graphic chipset looks similar, from a software POW,
	to the i810. With minor changes to Xfree 3.3.6 (make the i810
	driver recognise the i815 PCI ID), we can get it working on the i815
	too. I know NetBSD doesn't officially support the i81x graphic
	adapters, because of the lack of agpart driver. But it's possible
	to recompile a XF86_SVGA with i810 support without much pain, as
	there is a third-party agpart LKM, so adding i815 support in our tree
	is worth it.
	Tested with a i815 "full featured" but I can't see why it wouldn't
	work with a i815 dc100

>How-To-Repeat:
	try a XF86_SVGA recompiled with i810 support on a i815-based system
>Fix:
	apply this patch (also contains a minor change to make i810_accel.c
	compile on 1.5.1):

Index: i810.h
===================================================================
RCS file: /cvsroot/xsrc/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 i810.h
--- i810.h	2000/01/10 22:04:08	1.1.1.1
+++ i810.h	2001/07/24 13:10:27
@@ -170,6 +170,10 @@
 #define PCI_CHIP_I810_BRIDGE       0x7120
 #define PCI_CHIP_I810_DC100_BRIDGE 0x7122
 #define PCI_CHIP_I810_E_BRIDGE     0x7124
+#define PCI_CHIP_I815_DC100	   0x1102
+#define PCI_CHIP_I815_DC100_BRIDGE 0x1100
+#define PCI_CHIP_I815		   0x1132
+#define PCI_CHIP_I815_BRIDGE	   0x1130
 #endif
 
 #endif
Index: i810_accel.c
===================================================================
RCS file: /cvsroot/xsrc/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810_accel.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 i810_accel.c
--- i810_accel.c	2000/01/10 22:04:08	1.1.1.1
+++ i810_accel.c	2001/07/24 13:10:27
@@ -39,6 +39,7 @@
 
 #include <math.h>
 #include <stdio.h>
+#include <sys/types.h>
 #include <sys/mman.h>
 #include <signal.h>
 
Index: i810_driver.c
===================================================================
RCS file: /cvsroot/xsrc/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810_driver.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 i810_driver.c
--- i810_driver.c	2000/01/10 22:04:08	1.1.1.1
+++ i810_driver.c	2001/07/24 13:10:27
@@ -236,7 +236,7 @@
     int n;
 {
     static char *chipsets[] = {
-	"i810", "i810-dc100", "i810e"
+	"i810", "i810-dc100", "i810e", "i815-dc100", "i815"
     };
 
     if (n + 1 > sizeof(chipsets) / sizeof(char *))
@@ -333,9 +333,27 @@
 	       I810pcr = pcr; 
 	       break;
 
+	    case PCI_CHIP_I815_DC100:
+	       vga256InfoRec.chipset = I810Ident(3);
+	       I810Chipset = id;
+	       I810LinearAddr = pcr->_base0 & 0xfe000000; /* 32/64M */
+	       I810MMIOAddr = pcr->_base1 & 0xfff80000; /* 512K window */
+	       I810pcr = pcr; 
+	       break;
+
+	    case PCI_CHIP_I815:
+	       vga256InfoRec.chipset = I810Ident(4);
+	       I810Chipset = id;
+	       I810LinearAddr = pcr->_base0 & 0xfe000000; /* 32/64M */
+	       I810MMIOAddr = pcr->_base1 & 0xfff80000; /* 512K window */
+	       I810pcr = pcr; 
+	       break;
+
 	    case PCI_CHIP_I810_BRIDGE:
 	    case PCI_CHIP_I810_DC100_BRIDGE:
 	    case PCI_CHIP_I810_E_BRIDGE:
+	    case PCI_CHIP_I815_DC100_BRIDGE:
+	    case PCI_CHIP_I815_BRIDGE:
 	       I810BridgePcr = pcr;
 	       break;
 	    }
@@ -480,6 +498,8 @@
       case PCI_CHIP_I810:
       case PCI_CHIP_I810_DC100:
       case PCI_CHIP_I810_E:
+      case PCI_CHIP_I815_DC100:
+      case PCI_CHIP_I815:
 	 switch (vgaBitsPerPixel) {
 	 case 8:  vga256InfoRec.maxClock = 203000; break;
 	 case 16: vga256InfoRec.maxClock = 163000; break;
@@ -1272,6 +1292,12 @@
 	 break;
       case PCI_CHIP_I810_E:
 	 ErrorF("Intel i810e\n");
+	 break;
+      case PCI_CHIP_I815_DC100:
+	 ErrorF("Intel i815 DC100\n");
+	 break;
+      case PCI_CHIP_I815:
+	 ErrorF("Intel i815\n");
 	 break;
       }
    }
>Release-Note:
>Audit-Trail:
>Unformatted: