linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 0/3] Improve vb2_find_buffer
@ 2019-02-04 10:11 hverkuil-cisco
  2019-02-04 10:11 ` [PATCHv2 1/3] vb2: replace bool by bitfield in vb2_buffer hverkuil-cisco
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: hverkuil-cisco @ 2019-02-04 10:11 UTC (permalink / raw)
  To: linux-media
  Cc: Nicolas Dufresne, Tomasz Figa, Alexandre Courbot, Paul Kocialkowski

From: Hans Verkuil <hverkuil-cisco@xs4all.nl>

This supersedes my previous patch:
https://www.mail-archive.com/linux-media@vger.kernel.org/msg144099.html

Rather than marking a timestamp of 0 as 'special', I add a bitfield
to keep track of the validity of the timestamp.

The last patch also adds extra checks to verify that the found buffer
matches what is expected w.r.t. the number of planes and the size of
the planes.

I still think vb2_find_timestamp should increase some refcount for
the buffer since it is possible that the application requeues the
found buffer with a different dmabuf fd, thus potentially freeing the
buffer memory while it is still being processed.

But to be honest, I'm not sure how that should be done.

Regards,

	Hans

Hans Verkuil (3):
  vb2: replace bool by bitfield in vb2_buffer
  vb2: keep track of timestamp status
  vb2: add 'match' arg to vb2_find_buffer()

 drivers/media/common/videobuf2/videobuf2-core.c  | 15 +++++++++------
 drivers/media/common/videobuf2/videobuf2-v4l2.c  | 16 +++++++++++++---
 drivers/media/v4l2-core/v4l2-mem2mem.c           |  1 +
 .../staging/media/sunxi/cedrus/cedrus_mpeg2.c    |  8 ++++----
 include/media/videobuf2-core.h                   |  7 +++++--
 include/media/videobuf2-v4l2.h                   |  3 ++-
 6 files changed, 34 insertions(+), 16 deletions(-)

-- 
2.20.1


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

end of thread, other threads:[~2019-02-13 12:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-04 10:11 [PATCHv2 0/3] Improve vb2_find_buffer hverkuil-cisco
2019-02-04 10:11 ` [PATCHv2 1/3] vb2: replace bool by bitfield in vb2_buffer hverkuil-cisco
2019-02-13  9:22   ` Paul Kocialkowski
2019-02-04 10:11 ` [PATCHv2 2/3] vb2: keep track of timestamp status hverkuil-cisco
2019-02-13  9:22   ` Paul Kocialkowski
2019-02-04 10:11 ` [PATCHv2 3/3] vb2: add 'match' arg to vb2_find_buffer() hverkuil-cisco
2019-02-13  8:01   ` Alexandre Courbot
2019-02-13  8:20     ` Hans Verkuil
2019-02-13  9:08       ` Paul Kocialkowski
2019-02-13  9:39         ` Hans Verkuil
2019-02-13 12:51           ` Paul Kocialkowski

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).