RE: [PATCH/RFC] media: vb2: change queue initialization order

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

 



Hello,

On Wednesday, June 29, 2011 1:02 PM Hans Verkuil wrote:

> On Wednesday, June 29, 2011 12:44:48 Laurent Pinchart wrote:
> > Hi Marek,
> >
> > On Wednesday 29 June 2011 11:49:06 Marek Szyprowski wrote:
> > > This patch introduces VB2_STREAMON_WITHOUT_BUFFERS io flag and changes
> > > the order of operations during stream on operation. Now the buffer are
> > > first queued to the driver and then the start_streaming method is
> called.
> > > This resolves the most common case when the driver needs to know buffer
> > > addresses to enable dma engine and start streaming. For drivers that
> can
> > > handle start_streaming without queued buffers (mem2mem and 'one shot'
> > > capture case) a new VB2_STREAMON_WITHOUT_BUFFERS io flag has been
> > > introduced. Driver can set it to let videobuf2 know that it support
> this
> > > mode.
> >
> > Is starting/stopping DMA engines that expensive on most hardware ?
> Several
> > mails mentioned that drivers should keep one buffer around to avoid
> stopping
> > the DMA engine in case of buffer underrun. The OMAP3 ISP driver just
> stops
> the
> > ISP when it runs out of buffers, and restart it when a new buffer is
> queued.
> 
> Yes, this can be expensive. For video capture (e.g. from HDMI) you never
> want
> to stop capturing when you run out of buffers. Starting it up again will
> lead
> to a 1 or 2 frame delay, which is unacceptable for e.g. video conferencing.
> 
> And when I start the DMA engine I'd like to know whether only one buffer is
> queued or if I have two or more. In the latter case I can setup both the
> 'current' and 'next' pointers in the DMA engine which will make the first
> frame available quicker (otherwise you will probably get an additional
> frame
> delay).
> 
> > Switching the order of the start_streaming and __enqueue_in_driver calls
> would
> > make my life more difficult on the OMAP3 because I will have to check if
> the
> > queue is streaming in the qbuf callback. Your s5p-fimc driver has to
> check
> for
> > that as well. I wonder if it really helps for other drivers.
> 
> Why not add a 'is_streaming' boolean argument to enqueue_in_driver?

Again, thanks for the idea!

Best regards
-- 
Marek Szyprowski
Samsung Poland R&D Center


--
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