Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/riastradh-drm2]: src/sys/external/bsd/drm2/dist/drm For _DRM_CONSISTENT ...
details: https://anonhg.NetBSD.org/src/rev/a971f3d50a7b
branches: riastradh-drm2
changeset: 788223:a971f3d50a7b
user: riastradh <riastradh%NetBSD.org@localhost>
date: Wed Jul 24 02:47:34 2013 +0000
description:
For _DRM_CONSISTENT maps, hang the dmah on the drm_local_map.
The way the Linux code does it is a bookkeeping kludge that falls
down when we want to maintain more than just the PCI bus address, as
drm mmap will want in order to avoid vtophys.
diffstat:
sys/external/bsd/drm2/dist/drm/drm_bufs.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diffs (40 lines):
diff -r 8e8802ea2e26 -r a971f3d50a7b sys/external/bsd/drm2/dist/drm/drm_bufs.c
--- a/sys/external/bsd/drm2/dist/drm/drm_bufs.c Wed Jul 24 02:47:19 2013 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_bufs.c Wed Jul 24 02:47:34 2013 +0000
@@ -331,7 +331,11 @@
}
map->handle = dmah->vaddr;
map->offset = (unsigned long)dmah->busaddr;
+#ifdef __NetBSD__
+ map->lm_data.dmah = dmah;
+#else
kfree(dmah);
+#endif
break;
default:
kfree(map);
@@ -451,7 +455,9 @@
int drm_rmmap_locked(struct drm_device *dev, struct drm_local_map *map)
{
struct drm_map_list *r_list = NULL, *list_t;
+#ifndef __NetBSD__
drm_dma_handle_t dmah;
+#endif
int found = 0;
struct drm_master *master;
@@ -505,10 +511,14 @@
case _DRM_SCATTER_GATHER:
break;
case _DRM_CONSISTENT:
+#ifdef __NetBSD__
+ drm_pci_free(dev, map->lm_data.dmah);
+#else
dmah.vaddr = map->handle;
dmah.busaddr = map->offset;
dmah.size = map->size;
__drm_pci_free(dev, &dmah);
+#endif
break;
case _DRM_GEM:
DRM_ERROR("tried to rmmap GEM object\n");
Home |
Main Index |
Thread Index |
Old Index