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
Solved! Go to Solution.
i added munmap function after stream off and it's solved.
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