[PATCH for v4.20 2/2] extended-controls.rst: add note to the MPEG2 state controls

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil Add a note mentioning that these two controls are not part of the public API while they still stabilizing. Signed-off-by: Hans Verkuil --- Documentation/media/uapi/v4l/extended-controls.rst | 10 ++ 1 file changed, 10 insertions(+) diff --git

[PATCH for v4.20 0/2] cedrus: move MPEG controls out of the uAPI

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil The expectation was that the MPEG-2 state controls used by the staging cedrus driver were stable, or would only require one final change. However, it turns out that more changes are required, and that means that it is not such a good idea to have these controls in the public

[PATCH for v4.20 1/2] mpeg2-ctrls.h: move MPEG2 state controls to non-public header

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil The MPEG2 state controls for the cedrus stateless MPEG2 driver are not yet stable. Move them out of the public headers into media/mpeg2-ctrls.h. Eventually, once this has stabilized, they will be moved back to the public headers. Unfortunately I had to cast the control type

[PATCHv4 05/10] buffer.rst: clean up timecode documentation

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil V4L2_BUF_FLAG_TIMECODE is not video capture specific, so drop that part. The 'Timecodes' section was a bit messy, so that's cleaned up. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- Documentation/media/uapi/v4l/buffer.rst |

[PATCHv4 02/10] vb2: add tag support

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil Add support for tags to vb2. Besides just storing and setting the tag this patch also adds the vb2_find_tag() function that can be used to find a buffer with the given tag. This function will only look at DEQUEUED and DONE buffers, i.e. buffers that are already processed.

[PATCHv4 01/10] videodev2.h: add tag support

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil Add support for 'tags' to struct v4l2_buffer. These can be used by m2m devices so userspace can set a tag for an output buffer and this value will then be copied to the capture buffer(s). This tag can be used to refer to capture buffers, something that is needed by stateless

[PATCHv4 08/10] vim2m: add tag support

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil Copy tags in vim2m. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- drivers/media/platform/vim2m.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/vim2m.c

[PATCHv4 10/10] cedrus: add tag support

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil Replace old reference frame indices by new tag method. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- drivers/media/v4l2-core/v4l2-ctrls.c | 9 drivers/staging/media/sunxi/cedrus/cedrus.h | 9 +---

[PATCHv4 00/10] As was discussed here (among other places):

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil 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' where the application can assign a u32 tag to an output buffer, which is then copied to the capture buffer(s) derived from

[PATCHv4 06/10] v4l2-mem2mem: add v4l2_m2m_buf_copy_data helper function

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil Memory-to-memory devices should copy various parts of struct v4l2_buffer from the output buffer to the capture buffer. Add a helper function that does that to simplify the driver code. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre

[PATCHv4 03/10] v4l2-ioctl.c: log v4l2_buffer tag

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil When debugging is on, log the new tag field of struct v4l2_buffer as well. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- drivers/media/v4l2-core/v4l2-ioctl.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-)

[PATCHv4 07/10] vb2: add new supports_tags queue flag

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil Add new flag to indicate that buffer tags are supported. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- drivers/media/common/videobuf2/videobuf2-v4l2.c | 2 ++ include/media/videobuf2-core.h | 2 ++ 2 files

[PATCHv4 04/10] buffer.rst: document the new buffer tag feature.

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil Document V4L2_BUF_FLAG_TAG. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- Documentation/media/uapi/v4l/buffer.rst | 17 ++--- Documentation/media/uapi/v4l/vidioc-reqbufs.rst | 4 2 files changed, 18

[PATCHv4 09/10] vicodec: add tag support

2018-12-05 Thread hverkuil-cisco
From: Hans Verkuil Copy tags in vicodec. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- drivers/media/platform/vicodec/vicodec-core.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git

[PATCHv3 3/9] v4l2-ioctl.c: log v4l2_buffer tag

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil When debugging is on, log the new tag field of struct v4l2_buffer as well. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- drivers/media/v4l2-core/v4l2-ioctl.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-)

[PATCHv3 0/9] vb2/cedrus: add tag support

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil 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' where the application can assign a u32 tag to an output buffer, which is then

[PATCHv3 1/9] videodev2.h: add tag support

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil Add support for 'tags' to struct v4l2_buffer. These can be used by m2m devices so userspace can set a tag for an output buffer and this value will then be copied to the capture buffer(s). This tag can be used to refer to capture buffers, something that is needed by stateless

[PATCHv3 2/9] vb2: add tag support

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil Add support for tags to vb2. Besides just storing and setting the tag this patch also adds the vb2_find_tag() function that can be used to find a buffer with the given tag. This function will only look at DEQUEUED and DONE buffers, i.e. buffers that are already processed.

[PATCHv3 7/9] vim2m: add tag support

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil Copy tags in vim2m. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- drivers/media/platform/vim2m.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/media/platform/vim2m.c

[PATCHv3 5/9] v4l2-mem2mem: add v4l2_m2m_buf_copy_data helper function

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil Memory-to-memory devices should copy various parts of struct v4l2_buffer from the output buffer to the capture buffer. Add a helper function that does that to simplify the driver code. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre

[PATCHv3 4/9] buffer.rst: document the new buffer tag feature.

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil Document V4L2_BUF_FLAG_TAG. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- Documentation/media/uapi/v4l/buffer.rst | 32 ++- .../media/uapi/v4l/vidioc-reqbufs.rst | 4 +++ 2 files changed, 28

[PATCHv3 6/9] vb2: add new supports_tags queue flag

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil Add new flag to indicate that buffer tags are supported. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- drivers/media/common/videobuf2/videobuf2-v4l2.c | 2 ++ include/media/videobuf2-core.h | 2 ++ 2 files

[PATCHv3 8/9] vicodec: add tag support

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil Copy tags in vicodec. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- drivers/media/platform/vicodec/vicodec-core.c | 14 +++--- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git

[PATCHv3 9/9] cedrus: add tag support

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil Replace old reference frame indices by new tag method. Signed-off-by: Hans Verkuil Reviewed-by: Paul Kocialkowski Reviewed-by: Alexandre Courbot --- drivers/media/v4l2-core/v4l2-ctrls.c | 9 drivers/staging/media/sunxi/cedrus/cedrus.h | 9 +---

[PATCH 2/3] vim2m: add buf_validate callback

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil Split off the field validation from buf_prepare into a new buf_validate function. Field validation for output buffers should be done there since buf_prepare is not guaranteed to be called at QBUF time. Signed-off-by: Hans Verkuil --- drivers/media/platform/vim2m.c | 16

[PATCH 3/3] vivid: add buf_validate callback

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil Split off the field validation from buf_prepare into a new buf_validate function. Field validation for output buffers should be done there since buf_prepare is not guaranteed to be called at QBUF time. Signed-off-by: Hans Verkuil ---

[PATCH 1/3] vb2: add buf_validate callback

2018-12-03 Thread hverkuil-cisco
From: Hans Verkuil Adding the request API uncovered a pre-existing problem with validating output buffers. The problem is that for output buffers the driver has to validate the 'field' field of struct v4l2_buffer. This is critical when encoding or deinterlacing interlaced video. Drivers always

[PATCH for v4.20 3/5] vb2: keep a reference to the request until dqbuf

2018-11-28 Thread hverkuil-cisco
From: Hans Verkuil When vb2_buffer_done is called the buffer is unbound from the request and put. The media_request_object_put also 'put's the request reference. If the application has already closed the request fd, then that means that the request reference at that point goes to 0 and the whole

[PATCH for v4.20 4/5] vb2: don't unbind/put the object when going to state QUEUED

2018-11-28 Thread hverkuil-cisco
From: Hans Verkuil When a buffer is returned to state QUEUED (that happens when start_streaming fails), then do not unbind and put the object from the request. Nothing has changed yet, so just keep it as is. Signed-off-by: Hans Verkuil --- drivers/media/common/videobuf2/videobuf2-core.c | 2

[PATCH for v4.20 1/5] vb2: don't call __vb2_queue_cancel if vb2_start_streaming failed

2018-11-28 Thread hverkuil-cisco
From: Hans Verkuil vb2_start_streaming() already rolls back the buffers, so there is no need to call __vb2_queue_cancel(). Especially since __vb2_queue_cancel() does too much, such as zeroing the q->queued_count value, causing vb2 to think that no buffers have been queued. It appears that this

[PATCH for v4.20 0/5] vb2 fixes (mostly request API related)

2018-11-28 Thread hverkuil-cisco
From: Hans Verkuil While improving the v4l2-compliance tests I came across several vb2 problems. After modifying v4l2-compliance I was now able to use the vivid error injection feature to test what happens if VIDIOC_STREAMON fails and a following STREAMON succeeds. This generated patches 1/5

[PATCH for v4.20 5/5] vivid: drop v4l2_ctrl_request_complete() from start_streaming

2018-11-28 Thread hverkuil-cisco
From: Hans Verkuil If start_streaming() fails and all queued buffers are returned to vb2, then do not call v4l2_ctrl_request_complete(). Nothing happened to the request and the state should remain as it was before start_streaming was called. Signed-off-by: Hans Verkuil ---

[PATCH for v4.20 2/5] vb2: skip request checks for VIDIOC_PREPARE_BUF

2018-11-28 Thread hverkuil-cisco
From: Hans Verkuil VIDIOC_PREPARE_BUF should ignore V4L2_BUF_FLAG_REQUEST_FD since it isn't doing anything with requests. So inform vb2_queue_or_prepare_buf whether it is called from vb2_prepare_buf or vb2_qbuf and just return 0 in the first case. This was found when adding new v4l2-compliance