| plan 9 kernel history: overview | file list | diff list |
1998/0508/pc/vgamach64xx.c (diff list | history)
| 1998/0507/sys/src/9/pc/vgamach64xx.c:12,18 – 1998/0508/sys/src/9/pc/vgamach64xx.c:12,18 (short | long | prev | next) | ||
|
Add support for more cards.
rsc Fri Mar 4 12:44:25 2005 | ||
| 1998/0507 | #include "screen.h" /* | |
| 1998/0508 | * ATI Mach64(CT|ET|GP|GT|GU|VT|VU). | |
| 1998/0507 | */ static ushort mach64xxdid[] = { ('C'<<8)|'T', | |
| 1998/0507/sys/src/9/pc/vgamach64xx.c:35,46 – 1998/0508/sys/src/9/pc/vgamach64xx.c:35,44 | ||
| 1998/0507 | return nil; for(did = mach64xxdid; *did; did++){ if(*did == p->did) | |
| 1998/0508 | return p; | |
| 1998/0507 | } | |
| 1998/0508 | return nil; | |
| 1998/0507 | } static void | |
| 1998/0507/sys/src/9/pc/vgamach64xx.c:53,60 – 1998/0508/sys/src/9/pc/vgamach64xx.c:51,67 | ||
| 1998/0507 | */ if(scr->io) return; | |
| 1998/0508 | if(p = mach64xxpci()){ /* * The CT doesn't always have the I/O base address * in the PCI base registers. There is a way to find * it via the vendor-specific PCI config space but * this will do for now. */ scr->io = p->mem[1].bar & ~0x03; if(scr->io == 0 && p->did == ('C'<<8)|'T') scr->io = 0x2EC; } | |
| 1998/0507 | } static ulong | |
| 1998/0507/sys/src/9/pc/vgamach64xx.c:89,114 – 1998/0508/sys/src/9/pc/vgamach64xx.c:96,137 | ||
| 1998/0507 | return aperture; } | |
| 1998/0508 | enum { /* MM offset */ | |
| 1998/0507 |
| |
| 1998/0508 | CurClr0 = 0x0B, /* I/O Select */ CurClr1 = 0x0C, CurOffset = 0x0D, CurHVposn = 0x0E, CurHVoff = 0x0F, GenTestCntl = 0x19, | |
| 1998/0507 | }; | |
| 1998/0508 | static uchar mmoffset[] = { [CurClr0] 0x18, [CurClr1] 0x19, [CurOffset] 0x1a, [CurHVposn] 0x1b, [CurHVoff] 0x1c, [GenTestCntl] 0x34, }; | |
| 1998/0507 | static ulong ior32(VGAscr* scr, int r) { | |
| 1998/0508 | if(scr->io == 0x2EC || scr->io == 0x1C8) return inl((r<<10)+scr->io); return inl((mmoffset[r]<<2)+scr->io); | |
| 1998/0507 | } static void iow32(VGAscr* scr, int r, ulong l) { | |
| 1998/0508 | if(scr->io == 0x2EC || scr->io == 0x1C8) outl(((r)<<10)+scr->io, l); else outl((mmoffset[r]<<2)+scr->io, l); | |
| 1998/0507 | } static void | |