OSDN Git Service

media: atmel: atmel-isc-base: use streaming status when queueing buffers
authorEugen Hristev <eugen.hristev@microchip.com>
Tue, 3 May 2022 08:44:14 +0000 (10:44 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 13 May 2022 09:02:21 +0000 (11:02 +0200)
commite0cf8b9e3a52116905ff15cf9d0e68728da1542c
tree5e0ce1c32fcec0aa315fd7cdbaeb93f525ac1ae7
parent5f25abec8f21b7527c1223a354d23c270befddb3
media: atmel: atmel-isc-base: use streaming status when queueing buffers

During experiments with libcamera, it looks like vb2_is_streaming returns
true before our start streaming is called.
Order of operations is streamon -> queue -> start_streaming
ISC would have started the DMA immediately when a buffer is being added
to the vbqueue if the queue is streaming.
It is more safe to start the DMA after the start streaming of the driver is
called.
Thus, even if vb2queue is streaming, add the buffer to the dma queue of the
driver instead of actually starting the DMA process, if the start streaming
has not been called yet.
Tho achieve this, we have to use vb2_start_streaming_called instead of
vb2_is_streaming.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/atmel/atmel-isc-base.c