We are developing on custom hardware based around a DM365/8 which is being fed 640x960 4:2:0 video at 10fps from an FPGA. Our kernel is based off of the dvsdk branch of the linux-davinci git kernel, version 2.6.37.
We are having an issue wherein the VPFE capture drivers only fill n-1 buffers, for n queued buffers. For example:
VIDIOC_REQBUFS for 3 buffers - OK
VIDIOC_QUERYBUF/mmap all 3 buffers - OK
VIDIOC_QBUF all 3 buffers - OK
VIDIOC_STREAMON - OK
Wait 5 seconds
VIDIOC_QUERYBUF buffer 0, buffer.flags == V4L2_BUF_FLAG_MAPPED
| V4L2_BUF_FLAG_DONE
VIDIOC_QUERYBUF buffer 1, buffer.flags == V4L2_BUF_FLAG_MAPPED
| V4L2_BUF_FLAG_DONE
VIDIOC_QUERYBUF buffer 2, buffer.flags == V4L2_BUF_FLAG_MAPPED
| V4L2_BUF_FLAG_QUEUED
That last buffer should also have the V4L2_BUF_FLAG_DONE bit set, and not V4L2_BUF_FLAG_QUEUED. Kernel messages confirm that all of the capture interrupts are still firing. The line that seems to be preventing a captured frame from filling the last buffer is (in our case with the resizer chained) in vpfe_resizer.c:rsz_dma_isr:
if (!list_empty(&video_out->dma_queue) &&
video_out->cur_frm == video_out->next_frm)
schedule_capture = 1;
Specifically, video_out->dma_queue is empty, preventing the schedule_capture flag from being set and the subsequent call to vpfe_schedule_next_buffer.
This is even more problematic if you only queue 1 buffer... that buffer will never get filled, and any attempt to DQBUF that one buffer will hang indefinitely.
Is anybody familiar with why this may be happening?
Thanks in advance,
Frank