upstream: [media] mem2mem: add support for hardware buffered queue
authorPhilipp Zabel <p.zabel@pengutronix.de>
Mon, 3 Jun 2013 07:23:48 +0000 (04:23 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:51:24 +0000 (11:51 +0900)
commit16d0e950d3186e057550694a05eb86d71a9a5404
tree5e317781eac71ea82d7b54158d53b641af93848f
parent60e308561cbd95f4c7b52ad980a068631f268cab
upstream: [media] mem2mem: add support for hardware buffered queue

On mem2mem decoders with a hardware bitstream ringbuffer, to drain the
buffer at the end of the stream, remaining frames might need to be decoded
from the bitstream buffer without additional input buffers being provided.
To achieve this, allow a queue to be marked as buffered by the driver, and
allow scheduling of device_runs when buffered ready queues are empty.
This also allows a driver to copy input buffers into their bitstream
ringbuffer and immediately mark them as done to be dequeued.
The motivation for this patch is hardware assisted h.264 reordering support
in the coda driver. For high profile streams, the coda can hold back
out-of-order frames, causing a few mem2mem device runs in the beginning, that
don't produce any decompressed buffer at the v4l2 capture side. At the same
time, the last few frames can be decoded from the bitstream with mem2mem device
runs that don't need a new input buffer at the v4l2 output side. The decoder
command ioctl can be used to put the decoder into the ringbuffer draining
end-of-stream mode.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/v4l2-core/v4l2-mem2mem.c
include/media/v4l2-mem2mem.h