[{"id":25225,"web_url":"https://patchwork.libcamera.org/comment/25225/","msgid":"<20221003083553.ztdae4tks3a57u62@uno.localdomain>","date":"2022-10-03T08:35:53","subject":"Re: [libcamera-devel] [PATCH 3/4] pipeline: ipu3: Set bytesused\n\tbefore queuing parameters buffer","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent\n\nOn Sun, Oct 02, 2022 at 03:36:11AM +0300, 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> ---\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\nDo you think we need and helper ?\n\n        FrameBuffer::Private::setBytesUsed(unsigned int plane,\n                                           unsigned int bytesused) ?\n\n>  \timgu_->param_->queueBuffer(info->paramBuffer);\n>  \timgu_->stat_->queueBuffer(info->statBuffer);\n>  \timgu_->input_->queueBuffer(info->rawBuffer);\n> --\n> Regards,\n>\n> Laurent Pinchart\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 229CCBD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Oct 2022 08:35:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9172761F74;\n\tMon,  3 Oct 2022 10:35:56 +0200 (CEST)","from relay10.mail.gandi.net (relay10.mail.gandi.net\n\t[217.70.178.230])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6378561F74\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Oct 2022 10:35:55 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id A554224000F;\n\tMon,  3 Oct 2022 08:35:54 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664786156;\n\tbh=/C00EXcAiB5Z9kpKIohpM4+LWeIpemmlusksWfqWW/Q=;\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:Cc:\n\tFrom;\n\tb=IWvffM/jwZ3Fmmw83Tp422n2isQ8QofGJQncGbpjjNoqpdzSg46MAtO0no+8oLILY\n\tQVu+DvhHguuDGvgZSpoHvdCP8vjLoatKmaH5GeFNjnjC82pcGOdHX6727F2RqqAvCC\n\tG7tal2BsxBbA7CUJL9WmMuAXoZqOc3OIw4U9qcE55kerKEnTbtRAgQBgaNy+wXoNFx\n\tuAdVaFamretcZZaWAARyOrMCjHXr6CPJeuLpcemyD5WbIo8jJYM726RaPaLUKZAbtD\n\tzkE+BJKPDrqNrfoNgJfCBOUwKxY2zJAT0c2vrndC1hDHGdff/xEapW8PhNWvJEANiE\n\tOA8ix5wM6+RzQ==","Date":"Mon, 3 Oct 2022 10:35:53 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20221003083553.ztdae4tks3a57u62@uno.localdomain>","References":"<20221002003612.13603-1-laurent.pinchart@ideasonboard.com>\n\t<20221002003612.13603-4-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221002003612.13603-4-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 3/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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25236,"web_url":"https://patchwork.libcamera.org/comment/25236/","msgid":"<YzrUmRFxtDxzME6Q@pendragon.ideasonboard.com>","date":"2022-10-03T12:24:57","subject":"Re: [libcamera-devel] [PATCH 3/4] pipeline: ipu3: Set bytesused\n\tbefore queuing parameters buffer","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nOn Mon, Oct 03, 2022 at 10:35:53AM +0200, Jacopo Mondi wrote:\n> On Sun, Oct 02, 2022 at 03:36:11AM +0300, 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> > ---\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> \n> Do you think we need and helper ?\n> \n>         FrameBuffer::Private::setBytesUsed(unsigned int plane,\n>                                            unsigned int bytesused) ?\n\nI don't really see what this would bring.\n\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 9BAF4C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Oct 2022 12:25:02 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B35F1601BB;\n\tMon,  3 Oct 2022 14:25: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 511A0600E9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Oct 2022 14:25:00 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8DDFF440;\n\tMon,  3 Oct 2022 14:24:59 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664799901;\n\tbh=iG0PkkeRUC08p1aM51a2aWuIOHX3SLddrt17h59ZpEA=;\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:Cc:\n\tFrom;\n\tb=RkTnIJEZHvgeXViYYxtWQTAcYcF1hcDkQmOYrt5ltAmUO1bt67mfMqpKW56EV56Wg\n\tTOZDN09565hTqzJ7QmcEE2ZsveO+sjvr0qkiM9okLW6ySsiZ/HEJYzkAuVBcf+G5fq\n\tf0csNA1LilTlT/QWFdoBwYtetWR9zFpN+Tl7kHu2IkI46ZkV8+nXCeZ5MrGljdB3zw\n\tkYzpBz8divuSnnrWnc61Hf6sG+F286mvgzJw1/7Qlkgybg4nKSw7rJe7o3FB93JvFj\n\tkWQFBd3MYVkp6ZjZnI0wUDCK18f8VV8/oqVWRAFWzFXUHsZgtUNpQj46v7aa4z5L2x\n\t+z3EZoRB1ugMQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664799899;\n\tbh=iG0PkkeRUC08p1aM51a2aWuIOHX3SLddrt17h59ZpEA=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=s+JpRzYJZ8WPOCheVpdEBO79n6yHR93ZikwT+isfSrrRXxnPNHWrd7ok8vAiwOT84\n\tGowZ/TFHACWUik1kacn1y1cEIS1IDnf96/h6JGkIcK0h+Bw3XPVUDPZ96QBIB58sTr\n\t5rC5QRXdfSP7bzGVXNqXZTs9YUvNNGvRZFQ5+f0M="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"s+JpRzYJ\"; dkim-atps=neutral","Date":"Mon, 3 Oct 2022 15:24:57 +0300","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YzrUmRFxtDxzME6Q@pendragon.ideasonboard.com>","References":"<20221002003612.13603-1-laurent.pinchart@ideasonboard.com>\n\t<20221002003612.13603-4-laurent.pinchart@ideasonboard.com>\n\t<20221003083553.ztdae4tks3a57u62@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221003083553.ztdae4tks3a57u62@uno.localdomain>","Subject":"Re: [libcamera-devel] [PATCH 3/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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25237,"web_url":"https://patchwork.libcamera.org/comment/25237/","msgid":"<20221003124930.tqixa5nhkodm6th6@uno.localdomain>","date":"2022-10-03T12:49:30","subject":"Re: [libcamera-devel] [PATCH 3/4] pipeline: ipu3: Set bytesused\n\tbefore queuing parameters buffer","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"On Mon, Oct 03, 2022 at 03:24:57PM +0300, Laurent Pinchart wrote:\n> Hi Jacopo,\n>\n> On Mon, Oct 03, 2022 at 10:35:53AM +0200, Jacopo Mondi wrote:\n> > On Sun, Oct 02, 2022 at 03:36:11AM +0300, 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> > > ---\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> >\n> > Do you think we need and helper ?\n> >\n> >         FrameBuffer::Private::setBytesUsed(unsigned int plane,\n> >                                            unsigned int bytesused) ?\n>\n> I don't really see what this would bring.\n\nLess indirections for the callers ? If it's a repeated patter it might\nbe nice to have.\n\nNot a strict requirement for this series if you think it's not worth\nit.\n\nFor this and the RkISP equivalent\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n\n>\n> > >  \timgu_->param_->queueBuffer(info->paramBuffer);\n> > >  \timgu_->stat_->queueBuffer(info->statBuffer);\n> > >  \timgu_->input_->queueBuffer(info->rawBuffer);\n>\n> --\n> Regards,\n>\n> Laurent Pinchart","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 B74B8BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  3 Oct 2022 12:49:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 203E3601BB;\n\tMon,  3 Oct 2022 14:49:34 +0200 (CEST)","from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net\n\t[IPv6:2001:4b98:dc4:8::222])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4BEBD600E9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  3 Oct 2022 14:49:33 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby mail.gandi.net (Postfix) with ESMTPSA id C64BA40008;\n\tMon,  3 Oct 2022 12:49:32 +0000 (UTC)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664801374;\n\tbh=2kZJt37ACFKmAO7kB8hfI8ZTvHwfHOC7VguZhhRxFMA=;\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:Cc:\n\tFrom;\n\tb=omyv5fm5MYWFFl6nKnNf5I9Ues0L/YWr2pkYY2hK31vRJmhGHL/tn6QhdBdgWtXLm\n\t0xeFrUfakHFe9h455vOPESWLHSONJB1GDD9DHlwkxk0qHpAIKyEEXlQWRKQroCXxBo\n\tMZain1jkV0k7oa0Bo7LwxW61WZBhE5qSm974qTWZ/3V0GrRkN8gqhUJid1bG6P2wtT\n\txPVHKZsUYsfcKWjDn4q0Sph+hS5Fx41X+tzjjb7c2B9aLJCLGkhdpjrH8RDgmdfr7Y\n\tgvHGOct/0hHwdyZX3XkgaYoWpokBjCV+PWVOc1aLJAPYsPA0cjW54ikr0qAVe25NYs\n\tgU53zOMFhO65Q==","Date":"Mon, 3 Oct 2022 14:49:30 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20221003124930.tqixa5nhkodm6th6@uno.localdomain>","References":"<20221002003612.13603-1-laurent.pinchart@ideasonboard.com>\n\t<20221002003612.13603-4-laurent.pinchart@ideasonboard.com>\n\t<20221003083553.ztdae4tks3a57u62@uno.localdomain>\n\t<YzrUmRFxtDxzME6Q@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<YzrUmRFxtDxzME6Q@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 3/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":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]