summaryrefslogtreecommitdiff
path: root/linux-core/drm_drv.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-04-26 05:19:11 +0000
committerEric Anholt <anholt@freebsd.org>2005-04-26 05:19:11 +0000
commitec111d70fee0647c4c68a02c723d4a3729c93b56 (patch)
tree114a3257310a979d3dea484af62322ba007bf1e0 /linux-core/drm_drv.c
parent31a06d0baca9e378a773ca8bd350860546dd8a79 (diff)
Convert BSD code to mostly use bus_dma, the dma abstraction for dealing
with IOMMUs and such. There is one usage of the forbidden vtophys() left in drm_scatter.c which will be fixed up soon. This required a KPI change for drm_pci_alloc/free() to return/use a drm_dma_handle_t that keeps track of os-specific bits, rather than just passing around the vaddr/busaddr/size. Submitted by: Tonnerre Lombard (partially) Tested on: FreeBSD: Rage128 AGP/PCI Linux: Savage4 AGP/PCI
Diffstat (limited to 'linux-core/drm_drv.c')
-rw-r--r--linux-core/drm_drv.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/linux-core/drm_drv.c b/linux-core/drm_drv.c
index 42ca3c3b..069ecd3e 100644
--- a/linux-core/drm_drv.c
+++ b/linux-core/drm_drv.c
@@ -207,6 +207,8 @@ int drm_takedown(drm_device_t * dev)
r_list = (drm_map_list_t *) list;
if ((map = r_list->map)) {
+ drm_dma_handle_t dmah;
+
switch (map->type) {
case _DRM_REGISTERS:
case _DRM_FRAME_BUFFER:
@@ -230,8 +232,10 @@ int drm_takedown(drm_device_t * dev)
}
break;
case _DRM_CONSISTENT:
- drm_pci_free(dev, map->size,
- map->handle, map->offset);
+ dmah.vaddr = map->handle;
+ dmah.busaddr = map->offset;
+ dmah.size = map->size;
+ drm_pci_free(dev, &dmah);
break;
}
drm_free(map, sizeof(*map), DRM_MEM_MAPS);