Accessing camera frame buffer in iMX8M plus kernel.

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

Accessing camera frame buffer in iMX8M plus kernel.

418 Views
koilarulraj
Contributor II

Hi,

We are trying to modify first few bytes of camera frame buffer with custom header data for our use.

We are using Variscite DART-MX8MPLUS kit which is having binaries corresponding to following kernel source.
Git        : https://github.com/varigit/linux-imx.git
Branch : lf-5.10.y_var03

We found that, following two functions are continuously called during streaming.
    i) mxc_isi_cap_frame_write_done function in "drivers/staging/media/imx/imx8-isi-cap.c" &
   ii) vb2_core_dqbuf function in "drivers/media/common/videobuf2/videobuf2-core.c"

And we could get the frame pointer address by adding following codes inside mxc_isi_cap_frame_write_done function.

              void *ptr;
              unsigned int buf_size = 0;

              ptr = (__u32 *)vb2_plane_vaddr(vb2, 0);
              buf_size = vb2_plane_size(vb2, 0);


But if we try to access the memory pointed by ptr using memcpy function, the whole kit blocks and reboots after few seconds.
Could you please guide us on how to access the camera buffer in kernel space properly?

Thanks.

Tags (2)
0 Kudos
1 Reply

391 Views
Zhiming_Liu
NXP TechSupport
NXP TechSupport

Hi

Please try to refer function mxc_isi_channel_set_m2m_src_addr to get address

0 Kudos