Why is access to V4L2 buffers slower than other memory?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why is access to V4L2 buffers slower than other memory?

4,333 Views
Philip_FSL
Contributor IV

The reason for this is that the memory that the HW blocks like IPU and VPU must be non-cached.  As a result, the CPU operations are very slow versus similar operations using cached memory areas.  One way that you could get around this would be to allocate the memory as cached and then be sure to use cache maintenance routines to ensure coherency.  

0 Kudos
2 Replies

2,923 Views
joëlesponde
Contributor III

Hi,

Here is an example of kernel driver that helps user space applications allocate cached buffers ready to use with V4L2 API (V4L2_MEMORY_USERPTR):

GitHub - ikwzm/udmabuf: User space mappable dma buffer device driver for Linux. 

Regards,

0 Kudos

2,923 Views
erezsteinberg
Contributor IV

Hi Philips,

Working on iMX6DL (Linux 3.14.28), I am try to pass user-space buffers to V4L2 for capture from a MIPI sensor (V4L2_BUFFER_USERPTR).

However, I am not able to get any video using this method (with MMAP buffers it works fine).

I started a another thread about this - V4L2_MEMORY_USERPTR Support

Do you have any suggestions?

Any other method except USERPTR ?

Regards,

Erez

0 Kudos