[{"id":3354,"web_url":"https://patchwork.libcamera.org/comment/3354/","msgid":"<20200107170255.GL4871@pendragon.ideasonboard.com>","date":"2020-01-07T17:02:55","subject":"Re: [libcamera-devel] [PATCH 1/2] v4l2: camera_proxy: Fix try_fmt\n\tformat conversion","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Tue, Jan 07, 2020 at 05:50:37PM +0100, Jacopo Mondi wrote:\n> The set pixelformat field of struct v4l2_pix_format structure was\n> wrongly converted to PixelFormat by calling v4l2ToDrm(), with an already\n> converted 'format' argument.\n> \n> Fix this by calling the right drmToV4l2() conversion function.\n> \n> Fixes: 0ce8f2390b52 (\"v4l2: v4l2_compat: Add V4L2 compatibility layer\")\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThis kind of issue will be caught automatically once we extend the\nPixelFormat to become a real class.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/v4l2/v4l2_camera_proxy.cpp | 2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\n> index 559caba69270..dbcf333a761f 100644\n> --- a/src/v4l2/v4l2_camera_proxy.cpp\n> +++ b/src/v4l2/v4l2_camera_proxy.cpp\n> @@ -281,7 +281,7 @@ int V4L2CameraProxy::vidioc_try_fmt(struct v4l2_format *arg)\n>  \n>  \targ->fmt.pix.width        = size.width;\n>  \targ->fmt.pix.height       = size.height;\n> -\targ->fmt.pix.pixelformat  = v4l2ToDrm(format);\n> +\targ->fmt.pix.pixelformat  = drmToV4L2(format);\n>  \targ->fmt.pix.field        = V4L2_FIELD_NONE;\n>  \targ->fmt.pix.bytesperline = bplMultiplier(drmToV4L2(format)) *\n>  \t\t\t\t    arg->fmt.pix.width;","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9F1486063B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Jan 2020 18:03:06 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EF12D52F;\n\tTue,  7 Jan 2020 18:03:05 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1578416586;\n\tbh=UK+ot0P/8MJ9xBz4I7vnP6ZhFq+uJnaDKKlqY05UhA8=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=EhgEvMgIpL/CEsupfSvNhOiZOT4eKLBkdc8oQxAkQtKt9F25eIEWFtlVVzbm19prk\n\tG3uUUogsiHsiX6gowq0eh7MfFRVd4DTJCBUq1pve7FCrehVA/A/s5w+D8Sgg1NzAI+\n\tDCSP3WKljVOVmefxhn42OkS0O6hOnrJlcU3+DEJM=","Date":"Tue, 7 Jan 2020 19:02:55 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200107170255.GL4871@pendragon.ideasonboard.com>","References":"<20200107165038.93041-1-jacopo@jmondi.org>\n\t<20200107165038.93041-2-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200107165038.93041-2-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 1/2] v4l2: camera_proxy: Fix try_fmt\n\tformat conversion","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 07 Jan 2020 17:03:06 -0000"}}]