summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2006-02-21 11:10:05 +0000
committerDave Airlie <airlied@linux.ie>2006-02-21 11:10:05 +0000
commit9c0634bbadca0216749a336e587fd51b12307637 (patch)
treeb05e14b4acec5b56e991d3b6f3a87db9fece3408
parentabd3904bf0c5bcbf2f2ec117a3d2216dd5f830ef (diff)
set dma pages reserved
-rw-r--r--linux-core/drm_pci.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/linux-core/drm_pci.c b/linux-core/drm_pci.c
index f6e70389..b69dda22 100644
--- a/linux-core/drm_pci.c
+++ b/linux-core/drm_pci.c
@@ -50,7 +50,7 @@ drm_dma_handle_t *drm_pci_alloc(drm_device_t * dev, size_t size, size_t align,
dma_addr_t maxaddr)
{
drm_dma_handle_t *dmah;
-#if 0
+#if 1
unsigned long addr;
size_t sz;
#endif
@@ -112,7 +112,7 @@ drm_dma_handle_t *drm_pci_alloc(drm_device_t * dev, size_t size, size_t align,
memset(dmah->vaddr, 0, size);
-#if 0
+#if 1
/* XXX - Is virt_to_page() legal for consistent mem? */
/* Reserve */
for (addr = (unsigned long)dmah->vaddr, sz = size;
@@ -132,7 +132,7 @@ EXPORT_SYMBOL(drm_pci_alloc);
*/
void __drm_pci_free(drm_device_t * dev, drm_dma_handle_t *dmah)
{
-#if 0
+#if 1
unsigned long addr;
size_t sz;
#endif
@@ -147,10 +147,10 @@ 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 0
+#if 1
/* XXX - Is virt_to_page() legal for consistent mem? */
/* Unreserve */
- for (addr = (unsigned long)dmah->vaddr, sz = size;
+ for (addr = (unsigned long)dmah->vaddr, sz = dmah->size;
sz > 0; addr += PAGE_SIZE, sz -= PAGE_SIZE) {
ClearPageReserved(virt_to_page(addr));
}