svn commit: r189560 - head/sys/dev/drm
Robert Noland
rnoland at FreeBSD.org
Mon Mar 9 00:47:04 PDT 2009
Author: rnoland
Date: Mon Mar 9 07:47:03 2009
New Revision: 189560
URL: http://svn.freebsd.org/changeset/base/189560
Log:
Change the flags to bus_dmamem around to allow it to sleep waiting for
resources during allocation, but not during map load. Also, zero the
buffers here.
MFC after: 3 days
Modified:
head/sys/dev/drm/drm_pci.c
Modified: head/sys/dev/drm/drm_pci.c
==============================================================================
--- head/sys/dev/drm/drm_pci.c Mon Mar 9 07:38:22 2009 (r189559)
+++ head/sys/dev/drm/drm_pci.c Mon Mar 9 07:47:03 2009 (r189560)
@@ -83,15 +83,15 @@ drm_pci_alloc(struct drm_device *dev, si
maxaddr, BUS_SPACE_MAXADDR, /* lowaddr, highaddr */
NULL, NULL, /* filtfunc, filtfuncargs */
size, 1, size, /* maxsize, nsegs, maxsegsize */
- BUS_DMA_ALLOCNOW, NULL, NULL, /* flags, lockfunc, lockfuncargs */
+ 0, NULL, NULL, /* flags, lockfunc, lockfuncargs */
&dmah->tag);
if (ret != 0) {
free(dmah, DRM_MEM_DMA);
return NULL;
}
- ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr, BUS_DMA_NOWAIT,
- &dmah->map);
+ ret = bus_dmamem_alloc(dmah->tag, &dmah->vaddr,
+ BUS_DMA_WAITOK | BUS_DMA_ZERO, &dmah->map);
if (ret != 0) {
bus_dma_tag_destroy(dmah->tag);
free(dmah, DRM_MEM_DMA);
@@ -99,7 +99,7 @@ drm_pci_alloc(struct drm_device *dev, si
}
ret = bus_dmamap_load(dmah->tag, dmah->map, dmah->vaddr, size,
- drm_pci_busdma_callback, dmah, 0);
+ drm_pci_busdma_callback, dmah, BUS_DMA_NOWAIT);
if (ret != 0) {
bus_dmamem_free(dmah->tag, dmah->vaddr, dmah->map);
bus_dma_tag_destroy(dmah->tag);
More information about the svn-src-all
mailing list