imx8mm, how to change image sensor resolution without v4l2 re-setup?

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

imx8mm, how to change image sensor resolution without v4l2 re-setup?

Jump to solution
926 Views
bhgu
Contributor II

Hello,

i'm testing ov5640 sensor on imx8mm (mini) evk board with test code 'mx6s_v4l2_capture.c

i do v4l2 setup and close repeatedly in loop to change resolution.

when i did it many times, 

this log [cma: cma_alloc: alloc failed, req-size: 150 pages, ret: -12] happened at a time

and then finally system is not working at a time.

i guess cma is related because CmaFree is decreased when v4l2 re-setup.

 

can anyone help me

1. how to change resolution without v4l2 re-setup?

2. how to prevent cma size decreasing?

3. any help to solve this problem? ( what i only need is to keep changing resolution.) 

attached log file.

thank you for your help in advance

0 Kudos
Reply
1 Solution
913 Views
bhgu
Contributor II

i added munmap function after stream off and it's solved.

View solution in original post

0 Kudos
Reply
2 Replies
914 Views
bhgu
Contributor II

i added munmap function after stream off and it's solved.

0 Kudos
Reply
916 Views
bhgu
Contributor II

I have found why cma free size decrease when I re-setup v4l2.

do return before free of previous alloc at refcount_dec_and_test(func) - vb2_dc_put(func) in videobuf2-dma-contig.c

now I change in ignored refcount_dec_and_test(func) and could prevent decreasing cma size.

can I ignore refcount_dec_and_test function?

what side effect can I expect?

I would like to clear this issue

0 Kudos
Reply