summaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorBoris Brezillon2019-05-28 19:02:18 +0200
committerMauro Carvalho Chehab2019-05-29 16:48:34 +0200
commit32cddf9c94d81c4cd3c63fd1fe8ea9b98feac7e5 (patch)
tree8d9b4db8b60de17973970895fa8b9055eb40d0c2 /include/media
parentmedia: v4l2-common: Fix v4l2_fill_pixfmt[_mp]() prototypes (diff)
downloadkernel-qcow2-linux-32cddf9c94d81c4cd3c63fd1fe8ea9b98feac7e5.tar.gz
kernel-qcow2-linux-32cddf9c94d81c4cd3c63fd1fe8ea9b98feac7e5.tar.xz
kernel-qcow2-linux-32cddf9c94d81c4cd3c63fd1fe8ea9b98feac7e5.zip
media: v4l2-common: Add an helper to apply frmsize constraints
The rockchip VPU driver is open-coding this logic which seems pretty generic. Let's provide an helper to apply the min/max and alignment constraints on width/height. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/v4l2-common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/media/v4l2-common.h b/include/media/v4l2-common.h
index 3226bc8107cc..e826b154bc35 100644
--- a/include/media/v4l2-common.h
+++ b/include/media/v4l2-common.h
@@ -420,6 +420,8 @@ struct v4l2_format_info {
const struct v4l2_format_info *v4l2_format_info(u32 format);
+void v4l2_apply_frmsize_constraints(u32 *width, u32 *height,
+ const struct v4l2_frmsize_stepwise *frmsize);
int v4l2_fill_pixfmt(struct v4l2_pix_format *pixfmt, u32 pixelformat,
u32 width, u32 height);
int v4l2_fill_pixfmt_mp(struct v4l2_pix_format_mplane *pixfmt, u32 pixelformat,