This post shows a way to use the g2d physical contiguous memory for the ISI to using userptr, this buffer will handled by openCL directly, without memcpy.
This demo works on: i.MX8MP L6.1.36, It should be noted that only ISI can support userptr, ISP does not support userptr.
In NXP default BSP release, the camera application only support mmap, It maps buffers from kernel space to the user space, you need to memcpy these buffers for future use:
We can make some change to use the userptr to avoid this memcpy, the userptr, as the name implies, refers to the user space pointer. the application layer allocates the required memory space and passes it to the v4l2 driver layer as a pointer, the v4l2 driver saves the content of capture to the space indicated by the pointer.