From patchwork Wed Jun 26 09:48:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 11017365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E3B86C5 for ; Wed, 26 Jun 2019 09:48:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8AAB52857D for ; Wed, 26 Jun 2019 09:48:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7E85E2874B; Wed, 26 Jun 2019 09:48:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D52942857D for ; Wed, 26 Jun 2019 09:48:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726462AbfFZJsY (ORCPT ); Wed, 26 Jun 2019 05:48:24 -0400 Received: from lb1-smtp-cloud9.xs4all.net ([194.109.24.22]:38705 "EHLO lb1-smtp-cloud9.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726131AbfFZJsY (ORCPT ); Wed, 26 Jun 2019 05:48:24 -0400 Received: from [IPv6:2001:420:44c1:2579:95e:6256:39de:52a6] ([IPv6:2001:420:44c1:2579:95e:6256:39de:52a6]) by smtp-cloud9.xs4all.net with ESMTPA id g4XKhWFWlSfvXg4XNhK1Mz; Wed, 26 Jun 2019 11:48:22 +0200 From: Hans Verkuil Subject: [PATCH] v4l2-ioctl: call v4l_pix_format_touch() for TRY_FMT To: Linux Media Mailing List Cc: Florian Echtler , Philipp Zabel , Nick Dyer , Lucas Stach , Nick Dyer Message-ID: <95437142-2935-0d3f-073e-333dab4e17c0@xs4all.nl> Date: Wed, 26 Jun 2019 11:48:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 Content-Language: en-US X-CMAE-Envelope: MS4wfFyoGzJEgEZd/47G76IOnkofGjuWcC7se4APHNvvHvtDgVMyqmMPLdxRuiUgoe6iB0YfKOEpGbwRg723viFg+UXV4wsTcO04V2miqnZ+oLs3UStP34H/ 9OZjrfjWZgCnypgUN7l50eNvGIR1EMmaMcm0XdzbbRxD6gjpMIjBZqrgR1sq2iZFdGHGpQxUivICYssaqM0AnbI7MZrEIpmVOlitl07Ot7vv0mtxlgH4SIES cW2EjwgNiV0dMBAJgRQDt/FEEU9+IdTonMZdlMPcSFV4z3OHb0VMr3RR+LUBYtOT9S7j0C0qTUh+x2t2Mc6OAUkYpsly1S3iSw0kHwbJ9RHDQr8+S9q3vD4U T9+NgyyOCtyilf4WyNaRrDtu/XGmRVFp4xhQWUbmnCCGY8zoB3aI8oGhcqi/mkfRmvxtIt2iF1G4qN7so40y5mEQlFXnWg== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Philipp Zabel diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index b1f4b991dba6..c5c8c8ab7cf6 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1661,6 +1661,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))