diff options
author | rnoland <rnoland@FreeBSD.org> | 2009-03-09 07:47:03 +0000 |
---|---|---|
committer | rnoland <rnoland@FreeBSD.org> | 2009-03-09 07:47:03 +0000 |
commit | 10f014e6a9f29c19a7c3cb0d31f0af7435c79537 (patch) | |
tree | b98b7e90b6b83ff8bdf4d3536a4dc7e832990682 /sys/dev/drm | |
parent | e227ee6ba88ecd017f3bb1833746563665d65414 (diff) | |
download | FreeBSD-src-10f014e6a9f29c19a7c3cb0d31f0af7435c79537.zip FreeBSD-src-10f014e6a9f29c19a7c3cb0d31f0af7435c79537.tar.gz |
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
Diffstat (limited to 'sys/dev/drm')
-rw-r--r-- | sys/dev/drm/drm_pci.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/drm/drm_pci.c b/sys/dev/drm/drm_pci.c index 868e1fe..6d46c5d 100644 --- a/sys/dev/drm/drm_pci.c +++ b/sys/dev/drm/drm_pci.c @@ -83,15 +83,15 @@ drm_pci_alloc(struct drm_device *dev, size_t size, 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, size_t size, } 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); |