aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core/v4l2-ioctl.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2019-06-26 05:48:18 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-07-23 08:42:50 -0400
commit999a4312e871d9674f2ac8734820b8a242a0783f (patch)
tree6835231464cd5ca7b2d9d7a8313fc0e3118ec055 /drivers/media/v4l2-core/v4l2-ioctl.c
parentmedia: tegra-cec: use cec_notifier_cec_adap_(un)register (diff)
downloadlinux-dev-999a4312e871d9674f2ac8734820b8a242a0783f.tar.xz
linux-dev-999a4312e871d9674f2ac8734820b8a242a0783f.zip
media: v4l2-ioctl: call v4l_pix_format_touch() for TRY_FMT
The function v4l_pix_format_touch() is called for S_FMT to set v4l2_pix_format fields to default values for a v4l-touch device, but it wasn't called for TRY_FMT. Add this. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/v4l2-core/v4l2-ioctl.c')
-rw-r--r--drivers/media/v4l2-core/v4l2-ioctl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c
index 80efc581e3f9..e36629ae2203 100644
--- a/drivers/media/v4l2-core/v4l2-ioctl.c
+++ b/drivers/media/v4l2-core/v4l2-ioctl.c
@@ -1663,6 +1663,7 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
struct file *file, void *fh, void *arg)
{
struct v4l2_format *p = arg;
+ struct video_device *vfd = video_devdata(file);
int ret = check_fmt(file, p->type);
unsigned int i;
@@ -1679,6 +1680,8 @@ static int v4l_try_fmt(const struct v4l2_ioctl_ops *ops,
ret = ops->vidioc_try_fmt_vid_cap(file, fh, arg);
/* just in case the driver zeroed it again */
p->fmt.pix.priv = V4L2_PIX_FMT_PRIV_MAGIC;
+ if (vfd->vfl_type == VFL_TYPE_TOUCH)
+ v4l_pix_format_touch(&p->fmt.pix);
return ret;
case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE:
if (unlikely(!ops->vidioc_try_fmt_vid_cap_mplane))