upstream: [media] v4l: ti-vpe: Make sure in job_ready that we have the needed number...
authorArchit Taneja <archit@ti.com>
Wed, 15 Jan 2014 11:31:51 +0000 (08:31 -0300)
committerChanho Park <chanho61.park@samsung.com>
Tue, 18 Nov 2014 02:55:08 +0000 (11:55 +0900)
commit94cd67420a58a389f3a2c2a61994743e930a17fe
tree97070aa1e100693205c9dc6b8ee60513bb9ca31b
parentd04ad4baf757f6dde1fa1b07c8307a1e36ef28bf
upstream: [media] v4l: ti-vpe: Make sure in job_ready that we have the needed number of dst_bufs

VPE has a ctrl parameter which decides how many mem to mem transactions the
active job from the job queue can perform.

The driver's job_ready() made sure that the number of ready source buffers are
sufficient for the job to execute successfully. But it didn't make sure if
there are sufficient ready destination buffers in the capture queue for the
VPE output.

If the time taken by VPE to process a single frame is really slow, then it's
possible that we don't need to imply such a restriction on the dst queue, but
really fast transactions(small resolution, no de-interlacing) may cause us to
hit the condition where we don't have any free buffers for the VPE to write on.

Add the extra check in job_ready() to make sure we have the sufficient amount
of destination buffers.

Acked-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Archit Taneja <archit@ti.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/platform/ti-vpe/vpe.c