7 static void tnt2_getvmode(void *priv);
9 static struct fbdevice tnt2_fb = {
10 .getvmode = &tnt2_getvmode,
13 static unsigned int vgard(unsigned char a)
16 return (unsigned int)inb(0x3D5);
19 static void tnt2_getvmode(void *priv)
21 tnt2_fb.curmode.xres = (vgard(0x1) + 1) * 8;
22 tnt2_fb.curmode.yres = (vgard(0x12) | (vgard(0x7) & 2) << 7 | (vgard(0x7) & 0x40) << 3) + 1;
26 tnt2_fb.curmode.format = FB_RGB888;
27 tnt2_fb.curmode.bytestride = 4;
28 tnt2_fb.curmode.text = 0;
31 tnt2_fb.curmode.text = 1;
34 outputf("Unknown TNT2 format %d", vgard(0x28));
39 static int tnt2_probe(struct pci_dev *pci, void *data)
41 if (pci->bars[1].type != PCI_BAR_MEMORY32)
43 output("TNT2 BAR1 is not memory32?");
46 tnt2_fb.fbaddr = (void *)pci->bars[1].addr;
48 outputf("Found TNT2 with FB at %08x", tnt2_fb.fbaddr);
52 static struct pci_id tnt2_pci[] = {
53 {0x10DE, 0x0028, "TNT2", "RIVA TNT2"}
56 struct pci_driver tnt2_driver = {
60 .id_count = sizeof(tnt2_pci)/sizeof(tnt2_pci[0]),