aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/drm_vm.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2005-07-10 00:34:13 -0400
committerDave Airlie <airlied@linux.ie>2005-07-10 00:34:13 -0400
commit2d0f9eaff8e1d08b9707f5d24fe6b0ac95d231e3 (patch)
tree6602c6a936254ae1175073fdd3f800ed67730c17 /drivers/char/drm/drm_vm.c
parentf179bc77d09b9087bfc559d0368bba350342ac76 (diff)
drm: add _DRM_CONSISTENT map type
Added a new DRM map type _DRM_CONSISTENT for consistent PCI memory. It uses drm_pci_alloc/free for allocating/freeing the memory. From: Felix Kuhling <fxkuehl@gmx.de> Signed-off-by: David Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/drm_vm.c')
-rw-r--r--drivers/char/drm/drm_vm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/char/drm/drm_vm.c b/drivers/char/drm/drm_vm.c
index 621220f3f372..644ec9dadc05 100644
--- a/drivers/char/drm/drm_vm.c
+++ b/drivers/char/drm/drm_vm.c
@@ -228,6 +228,10 @@ static void drm_vm_shm_close(struct vm_area_struct *vma)
228 case _DRM_AGP: 228 case _DRM_AGP:
229 case _DRM_SCATTER_GATHER: 229 case _DRM_SCATTER_GATHER:
230 break; 230 break;
231 case _DRM_CONSISTENT:
232 drm_pci_free(dev, map->size, map->handle,
233 map->offset);
234 break;
231 } 235 }
232 drm_free(map, sizeof(*map), DRM_MEM_MAPS); 236 drm_free(map, sizeof(*map), DRM_MEM_MAPS);
233 } 237 }
@@ -645,6 +649,9 @@ int drm_mmap(struct file *filp, struct vm_area_struct *vma)
645 vma->vm_ops = &drm_vm_ops; 649 vma->vm_ops = &drm_vm_ops;
646 break; 650 break;
647 case _DRM_SHM: 651 case _DRM_SHM:
652 case _DRM_CONSISTENT:
653 /* Consistent memory is really like shared memory. It's only
654 * allocate in a different way */
648 vma->vm_ops = &drm_vm_shm_ops; 655 vma->vm_ops = &drm_vm_shm_ops;
649 vma->vm_private_data = (void *)map; 656 vma->vm_private_data = (void *)map;
650 /* Don't let this area swap. Change when 657 /* Don't let this area swap. Change when