summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpieuchot@nolizard.org>2013-08-08 18:23:46 +0200
committerJonathan Gray <jsg@jsg.id.au>2013-08-12 10:47:36 +1000
commit58bbe25523e607f5c22411107a6db9f517712cef (patch)
tree6a22a750bbf40eef97a7edd1d0e16ad4a2f081d3
parent0d3a9043c48260e51dee21cc2678c949780488e2 (diff)
If the AGP aperture base address is 0 assume that the bridge does not
support remapping for processor accesses. In this case do not map the GTT.
-rw-r--r--sys/dev/pci/drm/drm_agpsupport.c1
-rw-r--r--sys/dev/pci/drm/radeon/radeon_agp.c8
2 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/drm_agpsupport.c b/sys/dev/pci/drm/drm_agpsupport.c
index 757c8f65247..ee1e56c6848 100644
--- a/sys/dev/pci/drm/drm_agpsupport.c
+++ b/sys/dev/pci/drm/drm_agpsupport.c
@@ -370,6 +370,7 @@ drm_agp_init(void)
head->agpdev = agpdev;
agp_get_info(agpdev, &head->info);
head->base = head->info.ai_aperture_base;
+ head->cant_use_aperture = (head->base == 0);
TAILQ_INIT(&head->memory);
}
return (head);
diff --git a/sys/dev/pci/drm/radeon/radeon_agp.c b/sys/dev/pci/drm/radeon/radeon_agp.c
index 885a060e8b1..fdc140b1c66 100644
--- a/sys/dev/pci/drm/radeon/radeon_agp.c
+++ b/sys/dev/pci/drm/radeon/radeon_agp.c
@@ -251,9 +251,11 @@ int radeon_agp_init(struct radeon_device *rdev)
dev_info(rdev->dev, "GTT: %lluM 0x%08llX - 0x%08llX\n",
rdev->mc.gtt_size >> 20, rdev->mc.gtt_start, rdev->mc.gtt_end);
- start = atop(bus_space_mmap(rdev->memt, rdev->mc.gtt_start, 0, 0, 0));
- end = start + atop(rdev->mc.gtt_size);
- uvm_page_physload(start, end, start, end, PHYSLOAD_DEVICE);
+ if (!rdev->ddev->agp->cant_use_aperture) {
+ start = atop(bus_space_mmap(rdev->memt, rdev->mc.gtt_start, 0, 0, 0));
+ end = start + atop(rdev->mc.gtt_size);
+ uvm_page_physload(start, end, start, end, PHYSLOAD_DEVICE);
+ }
/* workaround some hw issues */
if (rdev->family < CHIP_R200) {