aboutsummaryrefslogtreecommitdiff
path: root/linux-core/drm_pci.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2006-02-21 10:28:47 +0000
committerDave Airlie <airlied@linux.ie>2006-02-21 10:28:47 +0000
commitabd3904bf0c5bcbf2f2ec117a3d2216dd5f830ef (patch)
tree64027aac75cb03bbd4db77f56b58edeaa1157052 /linux-core/drm_pci.c
parent22e41ef08338ae6dd59acbe6d4d8e50d83672816 (diff)
use coherent memory for PCI allocations with COMP flag
Diffstat (limited to 'linux-core/drm_pci.c')
-rw-r--r--linux-core/drm_pci.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/linux-core/drm_pci.c b/linux-core/drm_pci.c
index 0d3c8b23..f6e70389 100644
--- a/linux-core/drm_pci.c
+++ b/linux-core/drm_pci.c
@@ -83,7 +83,11 @@ drm_dma_handle_t *drm_pci_alloc(drm_device_t * dev, size_t size, size_t align,
return NULL;
dmah->size = size;
+#if 0
dmah->vaddr = pci_alloc_consistent(dev->pdev, size, &dmah->busaddr);
+#else
+ dmah->vaddr = dma_alloc_coherent(&dev->pdev->dev, size, &dmah->busaddr, GFP_KERNEL | __GFP_COMP);
+#endif
#ifdef DRM_DEBUG_MEMORY
if (dmah->vaddr == NULL) {
@@ -151,8 +155,13 @@ void __drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah)
ClearPageReserved(virt_to_page(addr));
}
#endif
+#if 0
pci_free_consistent(dev->pdev, dmah->size, dmah->vaddr,
dmah->busaddr);
+#else
+ dma_free_coherent(&dev->pdev->dev, dmah->size, dmah->vaddr,
+ dmah->busaddr);
+#endif
}
#ifdef DRM_DEBUG_MEMORY