[{"id":25282,"web_url":"https://patchwork.libcamera.org/comment/25282/","msgid":"<424c3dad-2b4e-0944-5a60-47e36d50ff4e@ideasonboard.com>","date":"2022-10-05T06:40:52","subject":"Re: [libcamera-devel] [PATCH v2 2/4] pipeline: ipu3: Set bytesused\n\tbefore 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/ipu3/ipu3.cpp | 4 ++++\n>   1 file changed, 4 insertions(+)\n>\n> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> index 93219a6c1134..3b892d9671c5 100644\n> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n> @@ -11,6 +11,8 @@\n>   #include <queue>\n>   #include <vector>\n>   \n> +#include <linux/intel-ipu3.h>\n> +\n>   #include <libcamera/base/log.h>\n>   #include <libcamera/base/utils.h>\n>   \n> @@ -1298,6 +1300,8 @@ void IPU3CameraData::paramsBufferReady(unsigned int id)\n>   \t\t\timgu_->viewfinder_->queueBuffer(outbuffer);\n>   \t}\n>   \n> +\tinfo->paramBuffer->_d()->metadata().planes()[0].bytesused =\n> +\t\tsizeof(struct ipu3_uapi_params);\n>   \timgu_->param_->queueBuffer(info->paramBuffer);\n>   \timgu_->stat_->queueBuffer(info->statBuffer);\n>   \timgu_->input_->queueBuffer(info->rawBuffer);","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 D0699BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Oct 2022 06:41:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 43F6661F7D;\n\tWed,  5 Oct 2022 08:41:01 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 05CDD603F3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Oct 2022 08:40:59 +0200 (CEST)","from [192.168.1.103] (unknown [103.251.226.94])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A43A3415;\n\tWed,  5 Oct 2022 08:40:57 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664952061;\n\tbh=JNX+ugqGW3YClipCykdzUN8X8Qj4Y+LoAvhHQ7p0HGI=;\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=A9WWTdzh07wbq7u7SqAHA2ZlcRyHltu/7hZCkJjnkFKjczk0VPOwDQSe9I7lGym8N\n\t0Osw0/BWn4ClZ8fFIcNjwTO/OstnQ7YYT3ttoaqfS1kzD1c8oY34TXVdcjx6YxgUJY\n\texWTRiXPfReip6caYALhTMsmgsbWMQjkz4D+O74L41PzS0UUi+Gx6A33ZghuHx6OrQ\n\ts09ZMtKP+6XpkhPtg9YQFcVUhTN8/FQ5pp0sAnZx7rtlgGWnD+6dzreaN+Q7zTUHxH\n\teBzehSPH9bN8up6ywVK3LI7t1uFliSkWtPcQUCQt2C5kW7c+5fmSbqVwuGCaASqrhc\n\txx/X/41nq2Jug==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664952058;\n\tbh=JNX+ugqGW3YClipCykdzUN8X8Qj4Y+LoAvhHQ7p0HGI=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=ZDZM8THElbATXevIbOteE9t07ruYO4lxqBrbXEbNLm6LMdfPs8C7SYXKress+caTc\n\tnOa0pFxvBbDRjBM0dJT0lQd9pNdl/3D63B69IEZYtnVxGHghnLRt1GeF9C6GnvKPAI\n\tJ4o2eNSa+KYcwOFcnsoHfsR+F8LPT8EK8GZm8uHE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ZDZM8THE\"; dkim-atps=neutral","Message-ID":"<424c3dad-2b4e-0944-5a60-47e36d50ff4e@ideasonboard.com>","Date":"Wed, 5 Oct 2022 12:10:52 +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-3-laurent.pinchart@ideasonboard.com>","In-Reply-To":"<20221004222903.6393-3-laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v2 2/4] pipeline: ipu3: Set bytesused\n\tbefore 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>"}}]