实现的驱动会调用vb2_buffer_done,唤醒q->done_wq的等待队列,此时应用即可DQBUF。
poll调用到驱动实现的字符设备poll接口
static const struct v4l2_file_operations video_file_ops = {
.owner = THIS_MODULE,
.unlocked_ioctl = video_ioctl2,
.open = video_open,
.release = video_release,
.poll = vb2_fop_poll,
.mmap = vb2_fop_mmap,
.read = vb2_fop_read,
};
vb2_fop_poll
--vb2_poll
----vb2_core_poll
------poll_wait
if (list_empty(&q->done_list)) {
/*
* If the last buffer was dequeued from a capture queue,
* return immediately. DQBUF will return -EPIPE.
*/
if (q->last_buffer_dequeued)
return POLLIN | POLLRDNORM;
poll_wait(file, &q->done_wq, wait);
}
文章为作者独立观点,不代表股票交易接口观点