Hi,
We are using Aptina sensor (mt9p031) and interfaced with csi parallel bus. My sensor output gives bayer RGB (GRGB format) height & width = 2580X1944. I am able to display monochrome image with 15 fps.
Using opencv I am able to convert bayer to RGB, but it's not meeting our requirement (i.e., FPS is too low). I know IMX6 doesn't have ISP, so I planned to implement demosaicing algoritim at driver level.
Please suggest is it possible to implement at driver level, if yes please share the required modifications..
Hi prasad,
.MX6 IPU don't make Bayer conversion. You will need to use some graphics library/API like gstreamer, ffmpeg and others to make this conversion using the CPU. IPU (IC, DP, DC and etc) doesn't recognize bayer as a valid image format. It can receive bayer format from CSI port as generic data.
I have this capture driver (using the IPU) and used the following code to map the DMA memory (from IPU) to user space: Normally because of DMA memory is mapped uncached, but due to size and usage, it's no problem to map it cached.
/* function to map DMA memory to user space */
static int capture_mmap(struct file *file, struct vm_area_struct *vm)
{
struct capture_device *dev = file->private_data;
size_t rsize = vm->vm_end - vm->vm_start;
int map;
int idx;
if ((vm->vm_pgoff * PAGE_SIZE) != (unsigned long)dev->dma)
return -ENOMEM; /* wrong base address */
if (down_interruptible(&dev->busy_lock))
return -EINTR;
vm->vm_page_prot = phys_mem_access_prot(file, vm->vm_pgoff, rsize, vm->vm_page_prot);
/* map DMA memory to user process (allow cacheable, since data much larger than cache) */
if (remap_pfn_range(vm, vm->vm_start, vm->vm_pgoff, rsize, vm->vm_page_prot))
map = EAGAIN;
else
map = 0;
up(&dev->busy_lock);
return map;
}
If you use some driver from NXP, you may have to change the driver.
Regards