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)
committerDom Cobley <popcornmix@gmail.com>
Mon, 21 Mar 2022 16:04:15 +0000 (16:04 +0000)
commitdee4f0d5e5b9973c8752439406c6b1cb4d885289
tree320e08dbddc07a2d665f90a5b09b203b54554e83
parentba5173607ccfc36b178aa14951ebcbadd282365d
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