summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrnoland <rnoland@FreeBSD.org>2009-03-22 20:58:29 +0000
committerrnoland <rnoland@FreeBSD.org>2009-03-22 20:58:29 +0000
commitadefdc48e52fbaa1b6f4cf1f49518c586ffdfa41 (patch)
treeac0fc52d7202213bf27e121546c57aaea5a3da80
parent162399433748b4694312b18291e502d43d058288 (diff)
downloadFreeBSD-src-adefdc48e52fbaa1b6f4cf1f49518c586ffdfa41.zip
FreeBSD-src-adefdc48e52fbaa1b6f4cf1f49518c586ffdfa41.tar.gz
Fix up the flags to bus_dmamem again. The man page incorrectly showed
the BUS_DMA_NOCACHE flags as being a valid flag for load instead of alloc. Discussed with: kib MFC after: 3 days
-rw-r--r--sys/dev/drm/ati_pcigart.c14
-rw-r--r--sys/dev/drm/drm_scatter.c5
2 files changed, 9 insertions, 10 deletions
diff --git a/sys/dev/drm/ati_pcigart.c b/sys/dev/drm/ati_pcigart.c
index 10be0af..7e5d207 100644
--- a/sys/dev/drm/ati_pcigart.c
+++ b/sys/dev/drm/ati_pcigart.c
@@ -82,8 +82,11 @@ drm_ati_alloc_pcigart_table(struct drm_device *dev,
return ENOMEM;
}
- ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr,
- BUS_DMA_WAITOK | BUS_DMA_ZERO, &dmah->map);
+ flags = BUS_DMA_WAITOK | BUS_DMA_ZERO;
+ if (gart_info->gart_reg_if == DRM_ATI_GART_IGP)
+ flags |= BUS_DMA_NOCACHE;
+
+ ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, flags, &dmah->map);
if (ret != 0) {
bus_dma_tag_destroy(dmah->tag);
free(dmah, DRM_MEM_DMA);
@@ -91,12 +94,9 @@ drm_ati_alloc_pcigart_table(struct drm_device *dev,
}
DRM_LOCK();
- flags = BUS_DMA_NOWAIT;
- if (gart_info->gart_reg_if == DRM_ATI_GART_IGP)
- flags |= BUS_DMA_NOCACHE;
-
ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr,
- gart_info->table_size, drm_ati_alloc_pcigart_table_cb, dmah, flags);
+ gart_info->table_size, drm_ati_alloc_pcigart_table_cb, dmah,
+ BUS_DMA_NOWAIT);
if (ret != 0) {
bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
bus_dma_tag_destroy(dmah->tag);
diff --git a/sys/dev/drm/drm_scatter.c b/sys/dev/drm/drm_scatter.c
index c884df1..6db7fcb 100644
--- a/sys/dev/drm/drm_scatter.c
+++ b/sys/dev/drm/drm_scatter.c
@@ -92,7 +92,7 @@ drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather *request)
}
ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr,
- BUS_DMA_WAITOK | BUS_DMA_ZERO, &dmah->map);
+ BUS_DMA_WAITOK | BUS_DMA_ZERO | BUS_DMA_NOCACHE, &dmah->map);
if (ret != 0) {
bus_dma_tag_destroy(dmah->tag);
free(dmah, DRM_MEM_DMA);
@@ -102,8 +102,7 @@ drm_sg_alloc(struct drm_device *dev, struct drm_scatter_gather *request)
}
ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr,
- request->size, drm_sg_alloc_cb, entry,
- BUS_DMA_NOWAIT | BUS_DMA_NOCACHE);
+ request->size, drm_sg_alloc_cb, entry, BUS_DMA_NOWAIT);
if (ret != 0) {
bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
bus_dma_tag_destroy(dmah->tag);
OpenPOWER on IntegriCloud