Index: agp_nvidia.c =================================================================== RCS file: /home/ncvs/src/sys/pci/agp_nvidia.c,v retrieving revision 1.6 diff -u -r1.6 agp_nvidia.c --- agp_nvidia.c 30 May 2004 20:00:40 -0000 1.6 +++ agp_nvidia.c 17 Jan 2005 05:20:35 -0000 @@ -281,8 +281,23 @@ { u_int8_t key; - key = ffs(pci_read_config(dev, AGP_NVIDIA_0_APSIZE, 1) & 0x0f); - return (1 << (24 + (key ? key : 5))); + key = pci_read_config(dev, AGP_NVIDIA_0_APSIZE, 1) & 0x0f; + + switch (key) { + case 0: + return 512 * 1024 * 1024; + case 8: + return 256 * 1024 * 1024; + case 12: + return 128 * 1024 * 1024; + case 14: + return 64 * 1024 * 1024; + case 15: + return 32 * 1024 * 1024; + default: + device_printf(dev, "Unknown aperture size key 0x%x\n", key); + return 0; + } } static int