RE: vb2: stop_streaming() callback redesign

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

 



Hello,

On Monday, April 04, 2011 12:27 PM Laurent Pinchart wrote:

> Hi Pawel,
> 
> On Monday 04 April 2011 01:51:05 Pawel Osciak wrote:
> > Hi,
> >
> > This series implements a slight redesign of the stop_streaming() callback
> > in vb2. The callback has been made obligatory. The drivers are expected to
> > finish all hardware operations and cede ownership of all buffers before
> > returning, but are not required to call vb2_buffer_done() for any of them.
> > The return value from this callback has also been removed.
> 
> What's the rationale behind this patch set ? I've always been against vb2
> controlling the stream state (vb2 should handle buffer management only in my
> opinion) and I'd like to understand why you want to make it required.

Let me remind the rationale behind {start,stop}_streaming. Basically there are
more than one place where you should change the DMA streaming state, some of
which are quite obvious (like stream_{on,off}), the others are a bit more
surprising (like the recently discussed first call to poll()). Also some of
the vb2 operations behaves differently if streaming is enabled or not
(like dqbuf), so vb2 needs to be aware of streaming state change.

The idea is also to simplify the drivers and provide a one-to-one functions for
all typical v4l2 operations: req_bufs, query_bufs, q_buf, dq_buf, stream_on,
stream_off, mmap, read/write, poll, so implementation of all from this list can
be a simple 4 lines of code, like the following:

static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
{
        struct vivi_dev *dev = video_drvdata(file);
        return vb2_streamon(&dev->vb_vidq, i);
}

> I plan to use vb2 in the uvcvideo driver (when vb2 will provide a way to
> handle device disconnection), and uvcvideo will stop the stream before calling
> vb2_queue_release() and vb2_streamoff(). Would will I need a stop_stream
> operation ?

What's prevents you from moving the dma streaming stop call from stop_streaming
ioctl and release file operation?

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