aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_device.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2009-07-10 08:36:26 -0400
committerDave Airlie <airlied@redhat.com>2009-07-15 03:13:18 -0400
commitad49f501867cba87e1e45e5ebae0b12435d68bf1 (patch)
tree4602e5caf96451b1dcdda7a38628d494466d2e20 /drivers/gpu/drm/radeon/radeon_device.c
parent61b576dbbe6a19d102c025ebc102a0749e2d3c80 (diff)
drm/ttm/radeon: add dma32 support.
This add support for using dma32 memory on gpus that really need it. Currently IGPs are left without DMA32 but we might need to change that unless we can fix rs690. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_device.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index 332911267eb..27a5ac96995 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -450,6 +450,7 @@ int radeon_device_init(struct radeon_device *rdev,
450 uint32_t flags) 450 uint32_t flags)
451{ 451{
452 int r, ret; 452 int r, ret;
453 int dma_bits;
453 454
454 DRM_INFO("radeon: Initializing kernel modesetting.\n"); 455 DRM_INFO("radeon: Initializing kernel modesetting.\n");
455 rdev->shutdown = false; 456 rdev->shutdown = false;
@@ -492,8 +493,20 @@ int radeon_device_init(struct radeon_device *rdev,
492 return r; 493 return r;
493 } 494 }
494 495
495 /* Report DMA addressing limitation */ 496 /* set DMA mask + need_dma32 flags.
496 r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(32)); 497 * PCIE - can handle 40-bits.
498 * IGP - can handle 40-bits (in theory)
499 * AGP - generally dma32 is safest
500 * PCI - only dma32
501 */
502 rdev->need_dma32 = false;
503 if (rdev->flags & RADEON_IS_AGP)
504 rdev->need_dma32 = true;
505 if (rdev->flags & RADEON_IS_PCI)
506 rdev->need_dma32 = true;
507
508 dma_bits = rdev->need_dma32 ? 32 : 40;
509 r = pci_set_dma_mask(rdev->pdev, DMA_BIT_MASK(dma_bits));
497 if (r) { 510 if (r) {
498 printk(KERN_WARNING "radeon: No suitable DMA available.\n"); 511 printk(KERN_WARNING "radeon: No suitable DMA available.\n");
499 } 512 }