Hello,


>
> No. All video capture/output devices all use DMA since it would be 
> prohibitively
> expensive for the CPU to do otherwise. So just dig in and implement it.

I am trying to better understand how read() operation actually use the
dma, but I can't yet understand it from code.

>
> No. The vmalloc variant is typically used for USB devices. For PCI(e) you'll
> use videobuf2-dma-contig if the DMA engine requires physically contiguous DMA,
> or videobuf2-dma-sg if the DMA engine supports scatter-gather DMA. You can
> start with dma-contig since the DMA code tends to be simpler, but it is
> harder to get the required physically contiguous memory if memory 
> fragmentation
> takes place. So you may not be able to allocate the buffers. dma-sg works much
> better with virtual memory.
>
>


1. I tried to understand the code implementation of videobuf2 with
regards to read():
read() ->
    vb2_read() ->
          __vb2_perform_fileio()->
             vb2_internal_dqbuf() &  copy_to_user()

Where is the actual allocation of dma contiguous memory ? Is done with
the userspace calloc() call in userspace (as shown in the v4l2 API
example) ? As I understand the calloc/malloc are not guaranteed to be
contiguous.
     How do I know if the try to allocate contigious memory has failed or not ?


2. Is the call to copy_to_user results is performance degredation of
read() in compare to mmap() method ?

Best Regards,
Ran
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to