[media] media: vb2: change queue initialization order
authorMarek Szyprowski <m.szyprowski@samsung.com>
Mon, 29 Aug 2011 11:51:49 +0000 (08:51 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 6 Sep 2011 18:07:20 +0000 (15:07 -0300)
commitbd323e28bd82dfd4b72c50ddc4d5fc24e3678b99
tree189921e2d10c732f8e439eb38a54f481ea4b05cf
parent8607c42540d0aa61ab562506681d34c245b91fae
[media] media: vb2: change queue initialization order

This patch changes the order of operations during stream on call. Now the
buffers 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. Additional parameter
to start_streaming method have been added to simplify drivers code. The
driver are now obliged to check if the number of queued buffers is high
enough to enable hardware streaming. If not - it can return an error. In
such case all the buffers that have been pre-queued are invalidated.

This patch also updates all videobuf2 clients to work properly with the
changed order of operations.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
CC: Pawel Osciak <pawel@osciak.com>
CC: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
CC: Hans Verkuil <hverkuil@xs4all.nl>
CC: Tomasz Stanislawski <t.stanislaws@samsung.com>
CC: Sylwester Nawrocki <s.nawrocki@samsung.com>
CC: Kamil Debski <k.debski@samsung.com>
CC: Jonathan Corbet <corbet@lwn.net>
CC: Josh Wu <josh.wu@atmel.com>
CC: Hans de Goede <hdegoede@redhat.com>
CC: Paul Mundt <lethal@linux-sh.org>
Tested-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/atmel-isi.c
drivers/media/video/marvell-ccic/mcam-core.c
drivers/media/video/pwc/pwc-if.c
drivers/media/video/s5p-fimc/fimc-capture.c
drivers/media/video/s5p-mfc/s5p_mfc_dec.c
drivers/media/video/s5p-mfc/s5p_mfc_enc.c
drivers/media/video/s5p-tv/mixer.h
drivers/media/video/s5p-tv/mixer_video.c
drivers/media/video/videobuf2-core.c
drivers/media/video/vivi.c
include/media/videobuf2-core.h