media: rpivid: Add a Pass0 to accumulate slices and rework job finish
authorJohn Cox <jc@kynesim.co.uk>
Thu, 11 Mar 2021 19:08:00 +0000 (19:08 +0000)
committerJohn Cox <jc@kynesim.co.uk>
Thu, 13 May 2021 16:47:06 +0000 (17:47 +0100)
commit61764446b17fe4b657d43a8e707cc6f8be874fe6
tree25aeb4aa18b37414718154691b3d779aca8fffd2
parenta67fc8b51775cb9fa7863b4dfd4b9627ca8fd966
media: rpivid: Add a Pass0 to accumulate slices and rework job finish

Due to overheads in assembling controls and requests it is worth having
the slice assembly phase separate from the h/w pass1 processing. Create
a queue to service pass1 rather than have the pass1 finished callback
trigger the next slice job.

This requires a rework of the logic that splits up the buffer and
request done events. This code contains two ways of doing that, we use
Ezequiel Garcias <ezequiel@collabora.com> solution, but expect that
in the future this will be handled by the framework in a cleaner manner.

Fix up the handling of some of the memory exhaustion crashes uncovered
in the process of writing this code.

Signed-off-by: John Cox <jc@kynesim.co.uk>
drivers/media/v4l2-core/v4l2-mem2mem.c
drivers/staging/media/rpivid/rpivid.c
drivers/staging/media/rpivid/rpivid.h
drivers/staging/media/rpivid/rpivid_dec.c
drivers/staging/media/rpivid/rpivid_h265.c
drivers/staging/media/rpivid/rpivid_hw.c