intel_gtt: Fix PTE offsets
authorBen Widawsky <ben@bwidawsk.net>
Tue, 5 Feb 2013 01:47:53 +0000 (17:47 -0800)
committerBen Widawsky <ben@bwidawsk.net>
Tue, 5 Feb 2013 01:53:48 +0000 (17:53 -0800)
Vincent sent me a patch which I think didn't go far enough.

Honestly, I don't even know what this tool does.

Reported-by: Cheah, Vincent Beng Keat <vincent.beng.keat.cheah@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
tools/intel_gtt.c

index 05d36d7..7885610 100644 (file)
@@ -70,10 +70,10 @@ int main(int argc, char **argv)
                                break;
                } else {
                        int offset;
-                       if (IS_G4X(devid) || IS_GEN5(devid))
-                               offset = MB(2);
-                       else
+                       if (IS_GEN4(devid))
                                offset = KB(512);
+                       else
+                               offset = MB(2);
                        if (pci_device_map_range(pci_dev,
                                                 pci_dev->regions[0].base_addr + offset,
                                                 offset,