Hello everyone, This mail contains an application to test DMABUF support in V4L2 for VIVI and S5P-FIMC drivers. The application was tested on linux-media for 3.7 with applied patchset "[PATCHv10 */26] Integration of videobuf2 with DMABUF" on Universal C210 board.
Compilation: 1. Fetch media-next, apply patchset [PATCHv10 */26] Integration of videobuf2 with DMABUF 2. Execute 'make headers_install' in kernel source 3. arm-linux-gnueabi-gcc v4l-dbuf.c -o v4l-dbuf -O2 -std=gnu99 -I kernel/usr/include/
This app creates a simple pipeline between VIVI and two FIMC instances. The scenario goes as follows:
1. FIMC0 creates an MMAP buffer at its OUTPUT queue. (testing vb2_dc_alloc) 2. The buffer from 1. is exported using VIDIOC_EXPBUF. (testing exporting in vb2-dma-config) 3. The DMABUF from 2. is imported to VIVI at CAPTURE queue. (testing importing in vb2-vmalloc) 4. Single frame is grabbed from VIVI into the DMABUF. (testing vb2_dc_dmabuf_ops_vmap) 5. FIMC1 creates an MMAP buffer at its OUTPUT queue. (testing vb2_dc_alloc) 6. he buffer from 5. is exported using VIDIOC_EXPBUF. (testing exporting in vb2-dma-config) 7. The DMABUF from 6. is imported by FIMC0 at CAPTURE queue. (testing importing in vb2-dma-contig) 8. FIMC0 is used to process a frame (format conversion/scaling/rotation). 9. USERPTR is created from an anonymous or file mapping. 10. The USERPTR from 9. is passed to FIMC1 at CAPTURE queue. (testing vb2_dc_get_userptr) 11. FIMC1 is used to process a frame (format conversion/scaling/rotation).
In the result, the USERPTR contains a frame from VIVI processed by two FIMCs. The app should produce 'Test passed' text on finish.
The command line options allow to control the stages of the process
-v path path to vivi [default /dev/video0] -f path path to fimc0 [default /dev/video1] -F path path to fimc1 [default /dev/video3] -0 4cc@WxH format between VIVI and FIMC0 -1 4cc@WxH format between FIMC0 and FIMC1 -2 4cc@WxH format between FIMC1 and destination -V vertical flip on FIMC0 -H horizontal flip on FIMC0 -R angle rotation by angle [default 0] on FIMC0 -m size[@file[+offset]] destination mapping, size 0 is adjusted automatically, no file indicate anonymous mapping -h print this help
For example: v4l-dbuf -0 RGBP@320x200 -H -R 90 -1 RGB4@96x96 -2 YUYV@32x32 -m 0@/dev/fb0
does:
- grab frame from VIVI 320x200 in RGBP (RGB565) format - convert this frame to 96x96 RGB4 (RGB32) format using FIMC0, apply horizontal flip and 90 degree rotation - convert result frame to 32x32 YUYV format using FIMC1 - store result in a framebuffer at /dev/fb0
Please, notice if destination file is missing, then anonymous mapping is used. On platforms that support no SYSMMU for FIMC it is very likely that VIDIOC_QBUF will fail if the size of the result image is larger than a single page.
Please use -v, -f, -F options to setup proper paths to VIVI, FIMC0-M2M, and FIMC1-M2M nodes.
At each stage the result frames are dumped in PPM format (Netpbm format). Currently, dumping is supported only for RGB565, RGB32 and YUYV formats. The app is not aborted if a format is not supported.
Please let us know if you have any further questions.
Regards, Tomasz Stanislawski