2001-02-15 13:58:45

by Jeff Garzik

[permalink] [raw]
Subject: Allocating lots of DMA RAM?

Hi all. Is the following loop (from drivers/sound/i810_audio.c among
others) still the best way to allocate a large amount of DMA RAM for
audio? ie. for audio devices that do not support scatter-gather.

Thanks,

Jeff



/* alloc as big a chunk as we can, FIXME: is this necessary ?? */
for (order = DMABUF_DEFAULTORDER; order >= DMABUF_MINORDER; order--)
if ((rawbuf = pci_alloc_consistent(state->card->pci_dev,
PAGE_SIZE << order,
&dmabuf->dma_handle)))
break;
if (!rawbuf)
return -ENOMEM;