From adefdc48e52fbaa1b6f4cf1f49518c586ffdfa41 Mon Sep 17 00:00:00 2001 From: rnoland Date: Sun, 22 Mar 2009 20:58:29 +0000 Subject: [PATCH] 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 --- sys/dev/drm/ati_pcigart.c | 14 +++++++------- sys/dev/drm/drm_scatter.c | 5 ++--- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/sys/dev/drm/ati_pcigart.c b/sys/dev/drm/ati_pcigart.c index 10be0af7fb2d..7e5d20761f73 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 c884df160d98..6db7fcb7fa1f 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);