All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCHv2 0/5] vb2/cedrus: add tag support
@ 2018-11-12  8:33 Hans Verkuil
  2018-11-12  8:33 ` [RFC PATCHv2 1/5] videodev2.h: " Hans Verkuil
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Hans Verkuil @ 2018-11-12  8:33 UTC (permalink / raw)
  To: linux-media; +Cc: Alexandre Courbot, maxime.ripard, paul.kocialkowski, tfiga

As was discussed here (among other places):

https://lkml.org/lkml/2018/10/19/440

using capture queue buffer indices to refer to reference frames is
not a good idea. A better idea is to use a 'tag' (thanks to Alexandre
for the excellent name; it's much better than 'cookie') where the 
application can assign a u64 tag to an output buffer, which is then 
copied to the capture buffer(s) derived from the output buffer.

A u64 is chosen since this allows userspace to also use pointers to
internal structures as 'tag'.

The first two patches add core tag support, the next two patches
add tag support to vim2m and vicodec, and the final patch (compile
tested only!) adds support to the cedrus driver.

I also removed the 'pad' fields from the mpeg2 control structs (it
should never been added in the first place) and aligned the structs
to a u32 boundary (u64 for the tag values).

The cedrus code now also copies the timestamps (didn't happen before)
but the sequence counter is still not set, that's something that should
still be added.

Note: if no buffer is found for a certain tag, then the dma address
is just set to 0. That happened before as well with invalid buffer
indices. This should be checked in the driver!

Also missing in this series are documentation updates, which is why
it is marked RFC.

I would very much appreciate it if someone can test the cedrus driver
with these changes. If it works, then I can prepare a real patch series
for 4.20. It would be really good if the API is as stable as we can make
it before 4.20 is released.

Regards,

        Hans

Changes since v1:

- cookie -> tag
- renamed v4l2_tag to v4l2_buffer_tag
- dropped spurious 'to' in the commit log of patch 1

Hans Verkuil (5):
  videodev2.h: add tag support
  vb2: add tag support
  vim2m: add tag support
  vicodec: add tag support
  cedrus: add tag support

 .../media/common/videobuf2/videobuf2-v4l2.c   | 43 ++++++++++++++++---
 drivers/media/platform/vicodec/vicodec-core.c |  3 ++
 drivers/media/platform/vim2m.c                |  3 ++
 drivers/media/v4l2-core/v4l2-ctrls.c          |  9 ----
 drivers/staging/media/sunxi/cedrus/cedrus.h   |  8 ++--
 .../staging/media/sunxi/cedrus/cedrus_dec.c   | 10 +++++
 .../staging/media/sunxi/cedrus/cedrus_mpeg2.c | 21 ++++-----
 include/media/videobuf2-v4l2.h                | 18 ++++++++
 include/uapi/linux/v4l2-controls.h            | 14 +++---
 include/uapi/linux/videodev2.h                | 37 +++++++++++++++-
 10 files changed, 127 insertions(+), 39 deletions(-)

-- 
2.19.1

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

end of thread, other threads:[~2018-11-13 17:47 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-12  8:33 [RFC PATCHv2 0/5] vb2/cedrus: add tag support Hans Verkuil
2018-11-12  8:33 ` [RFC PATCHv2 1/5] videodev2.h: " Hans Verkuil
2018-11-12 16:12   ` Paul Kocialkowski
2018-11-12  8:33 ` [RFC PATCHv2 2/5] vb2: " Hans Verkuil
2018-11-12  8:33 ` [RFC PATCHv2 3/5] vim2m: " Hans Verkuil
2018-11-12  8:33 ` [RFC PATCHv2 4/5] vicodec: " Hans Verkuil
2018-11-12  8:33 ` [RFC PATCHv2 5/5] cedrus: " Hans Verkuil
2018-11-12 16:47   ` Paul Kocialkowski
2018-11-13  7:50     ` Hans Verkuil
2018-11-12 16:32 ` [RFC PATCHv2 0/5] vb2/cedrus: " Paul Kocialkowski
2018-11-13  7:48   ` Hans Verkuil

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.