How to print the camera frame buffer?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to print the camera frame buffer?

2,008 Views
titusstalin
Contributor V

Dear All,

Can you please tell me how to print the content of camera frame buffer ?

Want to print the camera frame buffer in kernel driver for debugging purposes.

May be need to add some code in below code, don't know how to access.

drivers/media/platform/mxc/capture/mxc_v4l2_capture.c

Thanks for your support.

Regards,

Titus S.

Labels (2)
5 Replies

1,875 Views
rogerio_silva
NXP Employee
NXP Employee

Hi Titus,

You can check this user application example:

v4l2-examples/example2.c at master · rogeriorps/v4l2-examples · GitHub 

It's based on /unit_tests/mxc_v4l2_tvin.out

On lines 397 and 399 it makes a memcopy to copy the image between input and output buffers. The camera buffer is available at "capture_buffers[capture_buf.index].start" in this example.

Best regards,

Rogerio

1,875 Views
titusstalin
Contributor V

Thanks.

But I'm able to do this already in userspace.

I want to do it in kernel driver.

Can you please help me on this ?

Regards,

Titus S.

0 Kudos
Reply

1,875 Views
rogerio_silva
NXP Employee
NXP Employee

Supposing you're using an i.MX with IPU, in kernel drivers, the starting address of framebuffers are registered on EBA0 (and in case of double buffer also in EBA1) registers inside each IDMAC CPMEM Parameters. I think it will be easier to work on IPU drivers instead V4L2. They're located at linix/drivers/mxc/ipu3/. 

1,875 Views
titusstalin
Contributor V

Thanks Rogerio.

I'm able to print the contents of frame buffer.

       
char *pTmp = (char *) cam->frame[0].vaddress;
printk("\n ####################### Titus Start 0x%x 0x%x ####################\n",buf->m.offset,cam->frame[0].vaddress);   
    for(i=0;i<100;i++)
    {
    printk(" i -> %d, 0x%x ",i,*pTmp++);
    }

1,875 Views
rogerio_silva
NXP Employee
NXP Employee

Very good! Thanks for the feedback.

Rogerio

0 Kudos
Reply