Chris Nuernberger wrote: > On Monday 04 March 2002 03:33 pm, you wrote: > > > > Is there a way to know if the memory segment is dma-able? > > > > > > On ia32: In theory all memory below 4GB. For now bttv will DMA to > > > non-highmem pages. > > Basically, it would be sweet if the v4l2_buffer had a pointer on it, instead > of an index. Then you would just capture to that pointer. Chris The problem with this approach is that there are a some corner cases where it doesn't work that nicely: * If the driver has to touch the video data (which is true for many usb cams because they have to uncompress the data) it doesn't work nicely. Basically the driver will have to do a extra memcpy then: copy_to_user(v4l2_buffer->ptr,kernelbuf,size). * v4l2_buffer->ptr might point to memory which can't be reached by DMA. Not a big issue today, but I expect we'll run in trouble because of the 4G limit in near future. Given the number of people which have 1GB or above today I'd say around three years from now and it starts to become a serious problem. If the driver allocates the pages it can take care that it comes from a DMAable memory pool. For these reasons it simply is no option to drop the mmap() buffers altogether. And I don't like the idea to support both mmaped and application-allocated buffers that much because it makes drivers and applications more complex. Gerd -- #include </dev/tty>