linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC,WIP PATCH 0/2] cedrus: h264: add support for dynamically allocated ctrl arrays
@ 2021-07-02  2:01 daniel.almeida
  2021-07-02  2:01 ` [RFC,WIP PATCH 1/2] media: cedrus: fix double free daniel.almeida
  2021-07-02  2:01 ` [RFC,WIP PATCH 2/2] Cedrus: add support for dynamic arrays in H264 daniel.almeida
  0 siblings, 2 replies; 5+ messages in thread
From: daniel.almeida @ 2021-07-02  2:01 UTC (permalink / raw)
  To: hverkuil, jernej.skrabec, ezequiel, paul.kocialkowski, mripard
  Cc: kernel, linux-media, Daniel Almeida

From: Daniel Almeida <daniel.almeida@collabora.com>

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-07-19  9:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-02  2:01 [RFC,WIP PATCH 0/2] cedrus: h264: add support for dynamically allocated ctrl arrays daniel.almeida
2021-07-02  2:01 ` [RFC,WIP PATCH 1/2] media: cedrus: fix double free daniel.almeida
2021-07-19  8:17   ` Hans Verkuil
2021-07-02  2:01 ` [RFC,WIP PATCH 2/2] Cedrus: add support for dynamic arrays in H264 daniel.almeida
2021-07-19  8:23   ` Hans Verkuil

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).