Feb. 13, 2012
11:13 p.m.
Hi Mulyadi,
I read your code and I think kmalloc can be streamlined here. I recommend that kmalloc() allocate total memory needed to handle whole q->buf[] array. something like (CMIIW):
q->buf=kmalloc(sizeof(struct vb_buffer)*q->num_buffers,GFP_KERNEL)
then access q->buf[1], q->buf[2] etc.
struct vb2_queue { struct vb2_buffer *bufs[VIDEO_MAX_FRAME]; unsigned int num_buffers; }; bufs is an array of pointers to struct vb2_buffer. I was not able to use your kmalloc code. I get incompatible types errors when trying it. Any ideas? -- Peter Senna Tschudin peter.senna@gmail.com gpg id: 48274C36