Skip to content
Commit b32431b7 authored by Hans Verkuil's avatar Hans Verkuil
Browse files

media: vb2: refactor setting flags and caps, fix missing cap

Several functions implementing VIDIOC_REQBUFS and _CREATE_BUFS all use
almost the same code to fill in the flags and capability fields. Refactor
this into a new vb2_set_flags_and_caps() function that replaces the old
fill_buf_caps() and validate_memory_flags() functions.

This also fixes a bug where vb2_ioctl_create_bufs() would not set the
V4L2_BUF_CAP_SUPPORTS_MAX_NUM_BUFFERS cap and also not fill in the
max_num_buffers field.

Fixes: d055a76c

 ("media: core: Report the maximum possible number of buffers for the queue")
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: default avatarBenjamin Gaignard <benjamin.gaignard@collabora.com>
Acked-by: default avatarTomasz Figa <tfiga@chromium.org>
parent 78e23c3e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment