diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2006-08-28 09:28:10 +0200 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2006-08-28 09:28:10 +0200 |
commit | 4ddabd15620e6e4638a6a37a3a2b5bced626fcf9 (patch) | |
tree | e0b6916c0d34c4cb7adbfa87c8438124a9acbba8 /linux-core/drm_pci.c | |
parent | 886d3b3061cdf53f5a353cbaac843f63104d2658 (diff) | |
parent | 9b984b34e99f694e10251e15bc2ec1bc844dcca4 (diff) |
Merge branch 'master' of git+ssh://git.freedesktop.org/git/mesa/drm into drm-ttm-0-2-branch
Conflicts:
linux-core/drmP.h
Diffstat (limited to 'linux-core/drm_pci.c')
-rw-r--r-- | linux-core/drm_pci.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/linux-core/drm_pci.c b/linux-core/drm_pci.c index b69dda22..40a65f3e 100644 --- a/linux-core/drm_pci.c +++ b/linux-core/drm_pci.c @@ -37,6 +37,7 @@ */ #include <linux/pci.h> +#include <linux/dma-mapping.h> #include "drmP.h" /**********************************************************************/ @@ -83,11 +84,7 @@ 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) { @@ -112,14 +109,12 @@ drm_dma_handle_t *drm_pci_alloc(drm_device_t * dev, size_t size, size_t align, memset(dmah->vaddr, 0, size); -#if 1 /* XXX - Is virt_to_page() legal for consistent mem? */ /* Reserve */ for (addr = (unsigned long)dmah->vaddr, sz = size; sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { SetPageReserved(virt_to_page(addr)); } -#endif return dmah; } @@ -132,10 +127,8 @@ EXPORT_SYMBOL(drm_pci_alloc); */ void __drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah) { -#if 1 unsigned long addr; size_t sz; -#endif #ifdef DRM_DEBUG_MEMORY int area = DRM_MEM_DMA; int alloc_count; @@ -147,21 +140,14 @@ void __drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah) DRM_MEM_ERROR(area, "Attempt to free address 0\n"); #endif } else { -#if 1 /* XXX - Is virt_to_page() legal for consistent mem? */ /* Unreserve */ for (addr = (unsigned long)dmah->vaddr, sz = dmah->size; sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) { 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 @@ -181,7 +167,7 @@ void __drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah) } /** - * \brief Free a PCI consistent memory block. + * \brief Free a PCI consistent memory block */ void drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah) { |