[{"id":25283,"web_url":"https://patchwork.libcamera.org/comment/25283/","msgid":"<da534cad-a7c3-2730-9d49-43896748532e@ideasonboard.com>","date":"2022-10-05T06:41:16","subject":"Re: [libcamera-devel] [PATCH v2 3/4] pipeline: rkisp1: Set\n\tbytesused before queuing parameters buffer","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Laurent\n\nThank you for the patch\n\nOn 10/5/22 3:59 AM, Laurent Pinchart via libcamera-devel wrote:\n> The bytesused value for the parameters buffer is initialized to 0 and\n> never set. The V4L2 API specification indicates that, for an output\n> video device, the driver will set the bytesused value to the size of the\n> plane in that case. The videobuf2 framework does so, but considers this\n> as deprecated and prints a warning:\n>\n> [   54.375534] use of bytesused == 0 is deprecated and will be removed in the future,\n> [   54.388026] use the actual size instead.\n>\n> Fix it by setting bytesused to the correct value before queuing the\n> parameters buffer.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n>   src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 ++++\n>   1 file changed, 4 insertions(+)\n>\n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 25fbf9f1a0a9..455ee2a0a711 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -13,6 +13,7 @@\n>   #include <queue>\n>   \n>   #include <linux/media-bus-format.h>\n> +#include <linux/rkisp1-config.h>\n>   \n>   #include <libcamera/base/log.h>\n>   #include <libcamera/base/utils.h>\n> @@ -32,6 +33,7 @@\n>   #include \"libcamera/internal/camera_sensor.h\"\n>   #include \"libcamera/internal/delayed_controls.h\"\n>   #include \"libcamera/internal/device_enumerator.h\"\n> +#include \"libcamera/internal/framebuffer.h\"\n>   #include \"libcamera/internal/ipa_manager.h\"\n>   #include \"libcamera/internal/media_device.h\"\n>   #include \"libcamera/internal/pipeline_handler.h\"\n> @@ -362,6 +364,8 @@ void RkISP1CameraData::paramFilled(unsigned int frame)\n>   \tif (!info)\n>   \t\treturn;\n>   \n> +\tinfo->paramBuffer->_d()->metadata().planes()[0].bytesused =\n> +\t\tsizeof(struct rkisp1_params_cfg);\n>   \tpipe->param_->queueBuffer(info->paramBuffer);\n>   \tpipe->stat_->queueBuffer(info->statBuffer);\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 17559BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Oct 2022 06:41:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BC8EC61F85;\n\tWed,  5 Oct 2022 08:41:23 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5EB4E603F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Oct 2022 08:41:22 +0200 (CEST)","from [192.168.1.103] (unknown [103.251.226.94])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3678B415;\n\tWed,  5 Oct 2022 08:41:20 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664952083;\n\tbh=SYbTrbWlXUu+zM+W/V2KNlCjxU4GQ0O4X+W3DNAiuOM=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=BUsJeASHo/UwYjDkNXT2xjgyMWxoMW/e65O2l9R1NogqlLX1WN1k5YxQuwfJ6LfbF\n\t4GqgEuoanIIPBGpM3Refvm+jjbSzPhlr8pAJ/Ie9slmvEs6Tw+JPG5jZVOvcBoBjUy\n\tDlKL74I3uMTgTaxK2Bw6IARzDt6EU4lqCB3CKc39oQmYVf6wopxc0ypGgeFHuBAwOi\n\t/UOuiUcESofLthbFf7YR4J/NxG0CXVRwq+dWwIa0UzgYDvZNzAUrTv8cd/65RusviR\n\tLvgsVwv2gdLrL3feO37rHeu98ezJmxHi3/PTzVJP9bX2PNisZjv8wfwyu90DvWO1l8\n\t0vLWBtqjczTxw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664952082;\n\tbh=SYbTrbWlXUu+zM+W/V2KNlCjxU4GQ0O4X+W3DNAiuOM=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=Nd1wff4x7SwQfLi1lLojH3xvgzfDl6qUlrQZ6DYPDcZLydHnFKTIvRJ979tvfLvdh\n\tuNaMqBkq7EgZzxHenb3ksZr79H1jbNivqBglSlOSFKseS9lUehF8sjp8LF6hg4Blwn\n\tFBUcaw5KXXfeeNSNj04ckL0sNvPg7NfOYlzwotRY="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Nd1wff4x\"; dkim-atps=neutral","Message-ID":"<da534cad-a7c3-2730-9d49-43896748532e@ideasonboard.com>","Date":"Wed, 5 Oct 2022 12:11:16 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.2.1","Content-Language":"en-US","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20221004222903.6393-1-laurent.pinchart@ideasonboard.com>\n\t<20221004222903.6393-4-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20221004222903.6393-4-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v2 3/4] pipeline: rkisp1: Set\n\tbytesused before queuing parameters buffer","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>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]