From: Daniel Almeida <daniel.almeida@xxxxxxxxxxxxx> So far the Cedrus driver is able to decode a slice at a time in slice mode. Use the new flag "V4L2_CTRL_FLAG_DYNAMIC_ARRAY" and the new h264 slice array decode mode to support passing an array with all the slices at once from userspace. The device will process all slices in this array before calling v4l2_m2m_buf_done_and_job_finish, significantly reducing the amount of back and forth of data. This is marked as WIP because currently only the first slice will decode, all subsequent slices in the same frame will return CEDRUS_IRQ_ERROR. Also I haven't quite polished this yet. It is marked as RFC because I am not sure whether adding a new entry in v4l2_stateless_h264_decode_mode was the right call. Also, apparently only the slice offset is needed for subsequent slices (i.e. slice->header_bit_size), so I am a bit unsure whether userspace has to fill all fields for slices 2..n Daniel Almeida (2): media: cedrus: fix double free Cedrus: add support for dynamic arrays in H264 drivers/media/v4l2-core/v4l2-ctrls-defs.c | 1 + drivers/staging/media/sunxi/cedrus/cedrus.c | 35 ++++++++++++-- drivers/staging/media/sunxi/cedrus/cedrus.h | 18 ++++++++ .../staging/media/sunxi/cedrus/cedrus_dec.c | 33 +++++++++++++ .../staging/media/sunxi/cedrus/cedrus_h264.c | 46 ++++++++++++++++--- .../staging/media/sunxi/cedrus/cedrus_hw.c | 35 +++++++++++++- include/uapi/linux/v4l2-controls.h | 7 +++ 7 files changed, 163 insertions(+), 12 deletions(-) -- 2.32.0