diff options
Diffstat (limited to 'sys/dev/pci/agp_i810.c')
-rw-r--r-- | sys/dev/pci/agp_i810.c | 78 |
1 files changed, 5 insertions, 73 deletions
diff --git a/sys/dev/pci/agp_i810.c b/sys/dev/pci/agp_i810.c index c2485c9d0a1..a495fb6b08b 100644 --- a/sys/dev/pci/agp_i810.c +++ b/sys/dev/pci/agp_i810.c @@ -1,4 +1,4 @@ -/* $OpenBSD: agp_i810.c,v 1.74 2013/03/18 12:02:56 jsg Exp $ */ +/* $OpenBSD: agp_i810.c,v 1.75 2013/04/05 22:26:41 kettenis Exp $ */ /*- * Copyright (c) 2000 Doug Rabson @@ -506,79 +506,11 @@ agp_i810_attach(struct device *parent, struct device *self, void *aux) case CHIP_SANDYBRIDGE: case CHIP_IVYBRIDGE: - - /* Stolen memory is set up at the beginning of the aperture by - * the BIOS, consisting of the GATT followed by 4kb for the - * BIOS display. + /* + * Even though stolen memory exists on these machines, + * it isn't necessarily mapped into the aperture. */ - - gcc1 = (u_int16_t)pci_conf_read(bpa.pa_pc, bpa.pa_tag, - AGP_INTEL_SNB_GMCH_CTRL); - - stolen = 4; - - switch (gcc1 & AGP_INTEL_SNB_GMCH_GMS_STOLEN_MASK) { - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_32M: - isc->stolen = (32768 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_64M: - isc->stolen = (65536 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_96M: - isc->stolen = (98304 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_128M: - isc->stolen = (131072 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_160M: - isc->stolen = (163840 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_192M: - isc->stolen = (196608 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_224M: - isc->stolen = (229376 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_256M: - isc->stolen = (262144 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_288M: - isc->stolen = (294912 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_320M: - isc->stolen = (327680 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_352M: - isc->stolen = (360448 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_384M: - isc->stolen = (393216 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_416M: - isc->stolen = (425984 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_448M: - isc->stolen = (458752 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_480M: - isc->stolen = (491520 - stolen) * 1024 / 4096; - break; - case AGP_INTEL_SNB_GMCH_GMS_STOLEN_512M: - isc->stolen = (524288 - stolen) * 1024 / 4096; - break; - default: - isc->stolen = 0; - printf("unknown memory configuration, disabling\n"); - goto out; - } - -#ifdef DEBUG - if (isc->stolen > 0) { - printf(": detected %dk stolen memory", - isc->stolen * 4); - } else - printf(": no preallocated video memory\n"); -#endif + isc->stolen = 0; /* GATT address is already in there, make sure it's enabled */ gatt->ag_physical = READ4(AGP_I810_PGTBL_CTL) & ~1; |