V4L2 bayer data to Native Buffer

How can we capture mipi bayer data by DMA mode ?
The nvv4l2 samples using dma fd created by Native buffer, But NV Buffer can not support Bayer 10bit.

What should we do?

Thanks for your help!!

Hi,
You can refer to

/usr/src/jetson_multimedia_api/samples/v4l2cuda

There is gpuConvertYUYVtoRGB() in the sample, for your usecase, you would need to replace it with debayering function.

Thank you!

The v4l2cuda sample using MMAP or USERPTR , Do they have difference with DMABUF?
In my opnion, DMABUF offer less latency。Am I right?

Hi,
You can set -u -z to have raw data in CUDA buffer, and use CUDA programming for debayering. If you need to utilize hardware engine such as converter or encoder, you can create NvBuffer and copy the data to NvBuffer. For supported format, please refer to

/usr/src/jetson_multimedia_api/include/nvbuf_utils.h

Ok,I see.

For bayer sensor, I can’t using DMA buffer to capture V4L2 image.
Meanwhile, I can using userptr and cuda managed memory to avoid memory copy between cpu & gpu.

Thank you!