How to allocate very large contiguous frame buffers?

Jim Bray (jb@gandalf.cs.wcu.edu)
Fri, 15 Mar 1996 00:11:30 -0500 (EST)


I am working along on a driver for the Matrox Meteor FrameGrabber.
I am capturing single frames with it, and it is working nicely as an
autoloading module.
At present I also use kernel code to statically allocate a large
(1meg) dma-able frame buffer. This is cleary not good. kmalloc() can't
do what I need. I would rather avoid having to try something like
swapping everything out of low memory and rooting around the
free_area_lists looking for enough contiguous free pages. Couldn't be
done from a module, shouldn't be done by a device driver. I could
maybe __get_free_pages(GFP_DMA|GFP_KERNEL,NR_MEM_LISTS-1,
MAX_DMA_ADDRESS) and hope to get enough contiguous
PAGE_SIZE<<(NR_MEM_LISTS-1) objects to string together into say 3 or 4
meg worth of frame buffer, but if anyone has a better idea I'd like to
hear it. Someone else may need to do this someday, so it might be
worth writing it in page_alloc and exporting it in ksyms.

--Jim