I'll start with an explanation of what I'm trying to achieve as there might be better ways to avoid unnecessary memcpy's. I need to process images coming from Caspa camera in realtime using DSP. Now, to pass image data to the DSP it must be allocated in shared space either using DSPLink or CMEM. If memory mapped buffers are used for capture, every single frame needs to get copied to the shared memory. To avoid that, buffers allocated using CMEM could be set as user pointers for V4L2.
However, I get a kernel crash in v7_dma_inv_range when I try to do that. Everything is fine if I pass memory allocated using memalign() though. I have tried writting to/reading from CMEM memory which seems to be fine as well, so it's not a memory map configuration issue. "Unable to handle kernel paging request" suggests that the kernel might not like that CMEM memory is outside its address range. I attach both backtrace log and modified capture example (CMEM is required) if anyone is interested.
Now, is there any way I could fix that? Is it even possible to use shared memory with V4L2? Or whole approach is wrong and there are other ways to avoid memory copying in such case?