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 tnt2_fb.curmode.text = 1;
35 outputf("Unknown TNT2 format %x", vgard(0x28));
40 static int tnt2_probe(struct pci_dev *pci, void *data)
42 if (pci->bars[1].type != PCI_BAR_MEMORY32)
44 output("TNT2 BAR1 is not memory32?");
47 tnt2_fb.fbaddr = (void *)pci->bars[1].addr;
49 outputf("Found TNT2 with FB at %08x", tnt2_fb.fbaddr);
53 static struct pci_id tnt2_pci[] = {
54 {0x10DE, 0x0028, "TNT2", "RIVA TNT2"}
57 struct pci_driver tnt2_driver = {
61 .id_count = sizeof(tnt2_pci)/sizeof(tnt2_pci[0]),