From patchwork Tue Jan 7 16:50:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 2523 Return-Path: Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 801F160461 for ; Tue, 7 Jan 2020 17:48:20 +0100 (CET) X-Originating-IP: 93.34.114.233 Received: from uno.lan (93-34-114-233.ip49.fastwebnet.it [93.34.114.233]) (Authenticated sender: jacopo@jmondi.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 1AEF6C0010; Tue, 7 Jan 2020 16:48:19 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Tue, 7 Jan 2020 17:50:37 +0100 Message-Id: <20200107165038.93041-2-jacopo@jmondi.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200107165038.93041-1-jacopo@jmondi.org> References: <20200107165038.93041-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] v4l2: camera_proxy: Fix try_fmt format conversion X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Jan 2020 16:48:20 -0000 The set pixelformat field of struct v4l2_pix_format structure was wrongly converted to PixelFormat by calling v4l2ToDrm(), with an already converted 'format' argument. Fix this by calling the right drmToV4l2() conversion function. Fixes: 0ce8f2390b52 ("v4l2: v4l2_compat: Add V4L2 compatibility layer") Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/v4l2/v4l2_camera_proxy.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp index 559caba69270..dbcf333a761f 100644 --- a/src/v4l2/v4l2_camera_proxy.cpp +++ b/src/v4l2/v4l2_camera_proxy.cpp @@ -281,7 +281,7 @@ int V4L2CameraProxy::vidioc_try_fmt(struct v4l2_format *arg) arg->fmt.pix.width = size.width; arg->fmt.pix.height = size.height; - arg->fmt.pix.pixelformat = v4l2ToDrm(format); + arg->fmt.pix.pixelformat = drmToV4L2(format); arg->fmt.pix.field = V4L2_FIELD_NONE; arg->fmt.pix.bytesperline = bplMultiplier(drmToV4L2(format)) * arg->fmt.pix.width;