On 11/21/2015 11:20 PM, Ran Shalit wrote: > Hello, > > I am trying to understand the interrupt handler responsibility in > v4l2, also with respect to dma usage. I see that it is not defined as > part of the videobuf2 API. > > This is what I understand this far: > 1. start_streaming is responsible for getting into "streaming" state. > dma start should be trigggered at this point. Right. > 2. interrupt handler: is responsible for passing back the buffer to > user using vb2_buffer_done() call. Right. > > But what is the exact reponsibility of interrupt handler with respect > to dma usage ? Typically when the DMA has finished DMAing a frame it will generate an interrupt. The interrupt handler will then call vb2_buffer_done() handing the buffer back to the vb2 framework. Think of it as who owns the buffer: when buf_queue is called the buffer is handed from vb2 to the driver, and the driver calls vb2_buffer_done() when it is finished with the buffer (i.e. the data is DMAed into the buffer) and it hands it back to vb2. > In some of the drivers I see that the interrupt start/stop dma, but in > v4l2-pci-skeleton.c I don't see any usage of dma in the interrupt > handler, so I'm not sure. The interrupt handler is called in response of a DMA interrupt. How that interrupt is generated is hardware specific, so that's why you don't see it in the skeleton driver. Regards, Hans -- 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