aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ati_pcigart.c
diff options
context:
space:
mode:
authorDavid Miller <davem@davemloft.net>2009-02-12 05:15:34 -0500
committerDave Airlie <airlied@redhat.com>2009-03-13 00:24:00 -0400
commit296c6ae0e9b5ced1060b43a68b5f7e41a18509f6 (patch)
tree35d729262bc42162d031da22bb830c8d6c1ef43c /drivers/gpu/drm/ati_pcigart.c
parent5a7aad9a559a5488cbef7aa3d4d96fc28220b8ae (diff)
drm: ati_pcigart: Need to use PCI_DMA_BIDIRECTIONAL.
The buffers mapped by the PCI GART can be written to by the device, not just read. For example, this happens via the RB_RPTR writeback on Radeon. So we can't use PCI_DMA_TODEVICE else we'll get protection faults on IOMMU platforms. Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/gpu/drm/ati_pcigart.c')
-rw-r--r--drivers/gpu/drm/ati_pcigart.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/ati_pcigart.c b/drivers/gpu/drm/ati_pcigart.c
index 2cd827a56ffe..7972ec8762c7 100644
--- a/drivers/gpu/drm/ati_pcigart.c
+++ b/drivers/gpu/drm/ati_pcigart.c
@@ -77,7 +77,7 @@ int drm_ati_pcigart_cleanup(struct drm_device *dev, struct drm_ati_pcigart_info
77 if (!entry->busaddr[i]) 77 if (!entry->busaddr[i])
78 break; 78 break;
79 pci_unmap_page(dev->pdev, entry->busaddr[i], 79 pci_unmap_page(dev->pdev, entry->busaddr[i],
80 PAGE_SIZE, PCI_DMA_TODEVICE); 80 PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
81 } 81 }
82 82
83 if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) 83 if (gart_info->gart_table_location == DRM_ATI_GART_MAIN)
@@ -145,7 +145,7 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
145 for (i = 0; i < pages; i++) { 145 for (i = 0; i < pages; i++) {
146 /* we need to support large memory configurations */ 146 /* we need to support large memory configurations */
147 entry->busaddr[i] = pci_map_page(dev->pdev, entry->pagelist[i], 147 entry->busaddr[i] = pci_map_page(dev->pdev, entry->pagelist[i],
148 0, PAGE_SIZE, PCI_DMA_TODEVICE); 148 0, PAGE_SIZE, PCI_DMA_BIDIRECTIONAL);
149 if (entry->busaddr[i] == 0) { 149 if (entry->busaddr[i] == 0) {
150 DRM_ERROR("unable to map PCIGART pages!\n"); 150 DRM_ERROR("unable to map PCIGART pages!\n");
151 drm_ati_pcigart_cleanup(dev, gart_info); 151 drm_ati_pcigart_cleanup(dev, gart_info);