]> Joshua Wise's Git repositories - netwatch.git/blobdiff - video/tnt2.c
checksum_rect defaults to null
[netwatch.git] / video / tnt2.c
index 5ab5f0219b25faa43e3f79e032206a0f5a530b6f..c79912ca9a435a893a32f27d66bd779ed05999c2 100644 (file)
@@ -3,6 +3,9 @@
 #include <pci.h>
 #include <output.h>
 #include <fb.h>
 #include <pci.h>
 #include <output.h>
 #include <fb.h>
+#include <paging.h>
+
+#include "checksumrect.h"
 
 static void tnt2_getvmode(void *priv);
 
 
 static void tnt2_getvmode(void *priv);
 
@@ -26,12 +29,15 @@ static void tnt2_getvmode(void *priv)
                tnt2_fb.curmode.format = FB_RGB888;
                tnt2_fb.curmode.bytestride = 4;
                tnt2_fb.curmode.text = 0;
                tnt2_fb.curmode.format = FB_RGB888;
                tnt2_fb.curmode.bytestride = 4;
                tnt2_fb.curmode.text = 0;
+               tnt2_fb.checksum_rect = checksum_rect_generic32;
                break;
        case 0:
                tnt2_fb.curmode.text = 1;
                break;
        case 0:
                tnt2_fb.curmode.text = 1;
+               tnt2_fb.checksum_rect = (checksum_rect_t) 0;
                break;
        default:
                tnt2_fb.curmode.text = 1;
                break;
        default:
                tnt2_fb.curmode.text = 1;
+               tnt2_fb.checksum_rect = (checksum_rect_t) 0;
                outputf("Unknown TNT2 format %x", vgard(0x28));
                break;
        }
                outputf("Unknown TNT2 format %x", vgard(0x28));
                break;
        }
@@ -39,14 +45,21 @@ static void tnt2_getvmode(void *priv)
 
 static int tnt2_probe(struct pci_dev *pci, void *data)
 {
 
 static int tnt2_probe(struct pci_dev *pci, void *data)
 {
+       unsigned int p;
+
        if (pci->bars[1].type != PCI_BAR_MEMORY32)
        {
                output("TNT2 BAR1 is not memory32?");
                return 0;
        }
        if (pci->bars[1].type != PCI_BAR_MEMORY32)
        {
                output("TNT2 BAR1 is not memory32?");
                return 0;
        }
-       tnt2_fb.fbaddr = (void *)pci->bars[1].addr;
+       
+       /* Map 32M of memory. */
+       for (p = 0; p < 32; p += 4)
+               addmap_4m(0x40000000 + p*1024*1024, pci->bars[1].addr + p*1024*1024);
+       tnt2_fb.fbaddr = (void *)0x40000000;
+       
        fb = &tnt2_fb;
        fb = &tnt2_fb;
-       outputf("Found TNT2 with FB at %08x", tnt2_fb.fbaddr);
+       outputf("Found TNT2 with FB at %08x, mapped to %08x", pci->bars[1].addr, tnt2_fb.fbaddr);
        return 1;
 }
 
        return 1;
 }
 
This page took 0.021634 seconds and 4 git commands to generate.