path: root/drivers/staging/media/sunxi/cedrus/cedrus_video.h
diff options
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-08-30 06:26:24 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-10-01 16:40:53 -0300
commit965c71e8adcff315e16b58c00cd312598fc0222c (patch)
tree80598535d07246b8b833402b5fbe552b6d51a488 /drivers/staging/media/sunxi/cedrus/cedrus_video.h
parentdec555256f2cb61ee94975727ec2d4a8d592ac92 (diff)
media: cedrus: fix various format-related compliance issues
Initialize the context on open() with valid capture and output formats. It is good practice to always have valid formats internally. This solves one vb2 warning in the kernel log where the sizeimage value of the output format was 0 when requesting buffers, which is not allowed. It also simplifies the g_fmt ioctl implementations since they no longer have to check if a valid format was ever set. cedrus_prepare_format() now also validates sizeimage for the output formats, ensuring userspace can't set it to 0 since that would cause the same vb2 warning. Finally remove the sizeimage == 0 check in cedrus_try_fmt_vid_out() since cedrus_prepare_format() will now adjust this value. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Jernej Skrabec <jernej.skrabec@siol.net> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/staging/media/sunxi/cedrus/cedrus_video.h')
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.h b/drivers/staging/media/sunxi/cedrus/cedrus_video.h
index 0e4f7a8cccf2..05050c0a0921 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_video.h
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.h
@@ -26,5 +26,6 @@ extern const struct v4l2_ioctl_ops cedrus_ioctl_ops;
int cedrus_queue_init(void *priv, struct vb2_queue *src_vq,
struct vb2_queue *dst_vq);
+void cedrus_prepare_format(struct v4l2_pix_format *pix_fmt);

Privacy Policy