diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2018-05-21 04:54:45 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-08-31 11:14:44 -0400 |
commit | db6e8d57e2cd9fb77e6ceef8476912caecbd59b5 (patch) | |
tree | 0fb12ca81661df0f07005df9615453b34d5de638 /include/media | |
parent | 0af4e80bf24a3caf56cd94d6dbe6a8bb72536b1d (diff) | |
download | linux-db6e8d57e2cd9fb77e6ceef8476912caecbd59b5.tar.bz2 |
media: vb2: store userspace data in vb2_v4l2_buffer
The userspace-provided plane data needs to be stored in
vb2_v4l2_buffer. Currently this information is applied by
__fill_vb2_buffer() which is called by the core prepare_buf
and qbuf functions, but when using requests these functions
aren't called yet since the buffer won't be prepared until
the media request is actually queued.
In the meantime this information has to be stored somewhere
and vb2_v4l2_buffer is a good place for it.
The __fill_vb2_buffer callback now just copies the relevant
information from vb2_v4l2_buffer into the planes array.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/videobuf2-core.h | 3 | ||||
-rw-r--r-- | include/media/videobuf2-v4l2.h | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h index f6818f732f34..224c4820a044 100644 --- a/include/media/videobuf2-core.h +++ b/include/media/videobuf2-core.h @@ -417,8 +417,7 @@ struct vb2_ops { struct vb2_buf_ops { int (*verify_planes_array)(struct vb2_buffer *vb, const void *pb); void (*fill_user_buffer)(struct vb2_buffer *vb, void *pb); - int (*fill_vb2_buffer)(struct vb2_buffer *vb, const void *pb, - struct vb2_plane *planes); + int (*fill_vb2_buffer)(struct vb2_buffer *vb, struct vb2_plane *planes); void (*copy_timestamp)(struct vb2_buffer *vb, const void *pb); }; diff --git a/include/media/videobuf2-v4l2.h b/include/media/videobuf2-v4l2.h index 3d5e2d739f05..097bf3e6951d 100644 --- a/include/media/videobuf2-v4l2.h +++ b/include/media/videobuf2-v4l2.h @@ -32,6 +32,7 @@ * &enum v4l2_field. * @timecode: frame timecode. * @sequence: sequence count of this frame. + * @planes: plane information (userptr/fd, length, bytesused, data_offset). * * Should contain enough information to be able to cover all the fields * of &struct v4l2_buffer at ``videodev2.h``. @@ -43,6 +44,7 @@ struct vb2_v4l2_buffer { __u32 field; struct v4l2_timecode timecode; __u32 sequence; + struct vb2_plane planes[VB2_MAX_PLANES]; }; /* |