0) Wrote a kernel driver for my sensor and modifed the kernel driver framework to pass through grayscale images.
-Matt
Hi Matthew,
IPU can't support converting bayer format to RGB/YUV on the fly, it can only use generic mode to receive the CSI input bayer data to memory. The CPD can only be used to convert 10 bits color data to 8 bits. please check https://community.freescale.com/thread/302769
I suggest for demosaicing do it with OpenCL and conversion format to RGB888, such as mention on: Efficient, High-Quality Bayer Demosaic Filtering on GPUs
other communities link that can be helpful:
https://community.freescale.com/message/343717#comment-343717
Hope this helps
I've written and tested an OpenCL implementation of the logic and it works on my test workstation, but as with the OpenGL version, I'm having trouble with Android.
I'll post here what I've been able to figure out in case somebody else wanders in here in vain hope of clarification. Facts I've figured out:
1) OpenCL doesn't appear to be supported in Android. Don't even bother.
2) OpenGL processing performance for demosaic is good, but Vivante's driver/OpenGL implementation has a *staggeringly* slow glReadPixels() implementation that makes it completely worthless for getting data out of the GPU's memory space.
3) There apparently used to be support for a framebuffer backend to allow you to mmap() , but it doesn't appear to be supported in Android anymore (or at all?). I've never seen a version of the Android libraries that contains the -fb version, but it looks like the Linux BSP does.
4) It looks like *maybe* the solution is to render to texture and use Vivante's glTexDirectVIV family of function to get direct pointers to the texture memory. There's documentation for this readelf shows that functions by that name, but since I've never seen any header files that declare it (only online docs and forum posts), I'm having trouble getting it to link, so I can't tell you whether it actually works. It also seems to have some pretty severe format limitations.
So those are the wrong things you should avoid. Not sure what the right is yet, but a few more months of just trying every .so file I can find from every source except NXP may yield results. If it does, I'll surely post the right answer.
Thanks for the OpenCL idea. I'm using the logic in the document you referenced, but OpenGL is clearly getting in the way. Hopefully OpenCL won't worry about who has a display handle or which thread is the display thread.
I'll experiment with this and post my results.