This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

about request_buffer:not enough memory issue?

Hi everyone!

I want to get a full resolution 3.1MP(2048x1536) picture from my MT9p012
sensor.

but I failed when I req_buffers in the ipipe initialization procedure.

I allocate a 116M memory to my linux in the bootargs(mem=116M),so I
hink there is

 a enough space for I allocate 3MP ipipe buffer from linux(which will
require about

6M bytes),but when I execute the program, I only get the following
errors:


 starting mt9p012_ipipe_init

 IPIPE idm355_ipipe dm355_ipipe.2:

4.request_buffer:not enough memory

init  IPIPE_REQBUF fail

 IPIPE init fail

 what should I do to get the problem solved?

 any help will be appreciated!

 Thank you!

  • What function are you using to allocate the buffers?  If you are using VIDIOC_REQBUFS, this may have more to do with the memory space defined for V4L2 driver than the memory space allocated to Linux.

  • I have been doing a little more research; in DM355, IPIPE_REQBUF appears to replace VIDIOC_REBBUF.   Looking at the kernel source code and it appears that eventually, this translates into a get_free_pages call which attempts to allocate memory from ZONE_NORMAL (or GFP_KERNEL) space; therefore, you do not have the entire Linux space from where to allocate these buffers, but rather a subset.  Have you tried passing the proper resolution/buffer size via bootargs to see if it would make a difference; if so, could you try this, and please try to capture log of boot process to see if there any any potential error messages.  If this does not work, we will need to hunt lower and figure out where in the kernel the size of ZONE_NORMAL is defined.

  • Thank you for your reply! 
    In my opinion there is limit to apply for a buffer in my kernel !
    Since I am a demo version of the kernel!

    best regards,

    winky!