- // TODO: Support MMIO
- Log_Log("VIAVideo", "BAR0 = 0x%x", PCI_GetBAR(i, 0));
- Log_Log("VIAVideo", "BAR1 = 0x%x", PCI_GetBAR(i, 1));
- Log_Log("VIAVideo", "BAR2 = 0x%x", PCI_GetBAR(i, 2));
- Log_Log("VIAVideo", "BAR3 = 0x%x", PCI_GetBAR(i, 3));
- Log_Log("VIAVideo", "BAR4 = 0x%x", PCI_GetBAR(i, 4));
- Log_Log("VIAVideo", "BAR5 = 0x%x", PCI_GetBAR(i, 5));
-
- if( gVIAVideo_Info.FramebufferPhys ) continue ;
-
- gVIAVideo_Info.FramebufferPhys = PCI_GetBAR(i, 0);
- gVIAVideo_Info.MMIOPhys = PCI_GetBAR(i, 1);
-
- gVIAVideo_Info.Framebuffer = (void*)MM_MapHWPages(gVIAVideo_Info.FramebufferPhys, (1024*768*4)/PAGE_SIZE);
- // TODO: Map MMIO
+ for( int id = 0; (id = PCI_GetDevice(caVIAVideo_CardIDs[i][0], caVIAVideo_CardIDs[i][1], id)) != -1; id ++ )
+ {
+ // TODO: Support MMIO
+ Log_Log("VIAVideo", "BAR0 = 0x%x", PCI_GetBAR(id, 0));
+ Log_Log("VIAVideo", "BAR1 = 0x%x", PCI_GetBAR(id, 1));
+ Log_Log("VIAVideo", "BAR2 = 0x%x", PCI_GetBAR(id, 2));
+ Log_Log("VIAVideo", "BAR3 = 0x%x", PCI_GetBAR(id, 3));
+ Log_Log("VIAVideo", "BAR4 = 0x%x", PCI_GetBAR(id, 4));
+ Log_Log("VIAVideo", "BAR5 = 0x%x", PCI_GetBAR(id, 5));
+
+ // Ignore multiple cards
+ if( gVIAVideo_Info.FramebufferPhys ) continue ;
+
+ gVIAVideo_Info.FramebufferPhys = PCI_GetBAR(id, 0);
+ gVIAVideo_Info.MMIOPhys = PCI_GetBAR(id, 1);
+
+ gVIAVideo_Info.Framebuffer = (void*)MM_MapHWPages(
+ gVIAVideo_Info.FramebufferPhys, (1024*768*4)/PAGE_SIZE
+ );
+ // TODO: Map MMIO