dma start/stop & vb2 APIs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I am trying to understand how to implement dma transfer correctly
using videobuf2 APIs.

Normally, application will do semthing like this (video test API):

                xioctl(fd, VIDIOC_DQBUF, &buf)
                process_image(buffers[buf.index].start, buf.bytesused);
                xioctl(fd, VIDIOC_QBUF, &buf)

Therefore, in the driver below I will assume that:
1. VIDIOC_DQBUF -  trigger dma to start
2. interrupt handler in driver - stop dma
3. VIDIOC_QBUF - do nothing with dma.

But, on code review of the following two drivers, I see other things,
much more complex, and I don't understand it yet.

These are the two drivers I reviewed:
- STA2X11
- dt3511

In STA2X11 I see:

1. start_streaming - also triggers dma to start, why ?
2. buf_queue - add buffer to list & if No active buffer, active the
first one , and trigger dma. why do we trigger dma with buf_queue (I
would assume triggering is done with  VIDIOC_DQBUF -> buffer_finish) ?
3. buf_finish - remove buffer from list, but also get the next buffer
in list and trigger dma, why  do we need to trigger a next buffer ?
Isn't buffer_finish is called as a result of VIDIOC_QBUF ?


In dt3511 I see something else as following:
buf_queue()
{...
if (pd->curr_buf)
list_add_tail(&vb->done_entry, &pd->dmaq);
else {
pd->curr_buf = vb;
elbit_start_acq(pd);
}
...}

1. Again, why dma triggering is done as part of  buf_queue instead buf_finish
2. what's the meaning of the condition in this code, it is as if only
the first buffer in buf_queue i striggered, what about the next
ones,why do they only get into list without triggering dma ?
3. In this driver there is no buf_finish.

Thank you for any comments,
Ran
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux