[{"id":2520,"web_url":"https://patchwork.libcamera.org/comment/2520/","msgid":"<20190828160249.ydypobhuj4lt6mfk@uno.localdomain>","date":"2019-08-28T16:02:49","subject":"Re: [libcamera-devel] [PATCH 03/13] libcamera: pipeline: Add method\n\tto prepare buffer for IPA","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Niklas,\n\nOn Wed, Aug 28, 2019 at 03:17:00AM +0200, Niklas Söderlund wrote:\n> The pipeline handlers dealing with buffers outside the request coming\n> from an application needs to prepare Buffer objects before they can be\n> used by other the libcamera functions. For objects coming from the user\n> this is done by the Camera before the Buffers reach the pipeline\n> handler. Add a new method prepareInternalBuffer() to aid with this\n> preparation.\n\nAs clarified offline, this should be reworded to specify you're here\ntalking about internal buffers used by pipelines for\nstatistics/controls (also for internal buffer queues, like the\nCIO2->IMGU one in the IPU3 ? )\n\n>\n> Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> ---\n>  src/libcamera/include/pipeline_handler.h |  2 ++\n>  src/libcamera/pipeline_handler.cpp       | 18 ++++++++++++++++++\n>  2 files changed, 20 insertions(+)\n>\n> diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> index ffc7adb802215313..91d40ef40a465c4e 100644\n> --- a/src/libcamera/include/pipeline_handler.h\n> +++ b/src/libcamera/include/pipeline_handler.h\n> @@ -98,6 +98,8 @@ protected:\n>\n>  \tCameraData *cameraData(const Camera *camera);\n>\n> +\tvoid prepareInternalBuffer(Buffer *buffer, Request *request,\n> +\t\t\t\t   BufferMemory *mem);\n\nDo you think this will expand ? Otherwise I wonder if this should not\nbe made Buffer operation, like Buffer::prepare(req, mem); or other\nnames that better convey the idea of initialization\noutside-of-a-request...\n\n\n>  \tCameraManager *manager_;\n>\n>  private:\n> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> index 89b67806597728f9..766fd496306ece9c 100644\n> --- a/src/libcamera/pipeline_handler.cpp\n> +++ b/src/libcamera/pipeline_handler.cpp\n> @@ -484,6 +484,24 @@ void PipelineHandler::hotplugMediaDevice(MediaDevice *media)\n>  \tmedia->disconnected.connect(this, &PipelineHandler::mediaDeviceDisconnected);\n>  }\n>\n> +/**\n> + * \\brief Prepare buffer for internal usage by a pipeline handler\n> + * \\param[in,out] buffer The buffer to prepare\n> + * \\param[in] request The request to associate the \\a buffer with\n> + * \\param[in] mem The memory to associate the \\a buffer with\n> + *\n> + * Pipeline handlers creating internal buffers to facilitate data flow in the\n> + * pipeline need to prepare the buffers by setting up the buffer object state.\n> + * This function help pipeline handler implementations to perform this\n> + * preparation.\n> + */\n> +void PipelineHandler::prepareInternalBuffer(Buffer *buffer, Request *request,\n> +\t\t\t\t\t    BufferMemory *mem)\n> +{\n> +\tbuffer->request_ = request;\n> +\tbuffer->mem_ = mem;\n> +}\n> +\n>  /**\n>   * \\brief Slot for the MediaDevice disconnected signal\n>   */\n> --\n> 2.22.1\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay12.mail.gandi.net (relay12.mail.gandi.net\n\t[217.70.178.232])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ADC3360BF6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Aug 2019 18:01:17 +0200 (CEST)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay12.mail.gandi.net (Postfix) with ESMTPSA id 3993D200005;\n\tWed, 28 Aug 2019 16:01:16 +0000 (UTC)"],"Date":"Wed, 28 Aug 2019 18:02:49 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Niklas =?utf-8?q?S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190828160249.ydypobhuj4lt6mfk@uno.localdomain>","References":"<20190828011710.32128-1-niklas.soderlund@ragnatech.se>\n\t<20190828011710.32128-4-niklas.soderlund@ragnatech.se>","MIME-Version":"1.0","Content-Type":"multipart/signed; micalg=pgp-sha256;\n\tprotocol=\"application/pgp-signature\"; boundary=\"574w4ozjn4q4mwxf\"","Content-Disposition":"inline","In-Reply-To":"<20190828011710.32128-4-niklas.soderlund@ragnatech.se>","User-Agent":"NeoMutt/20180716","Subject":"Re: [libcamera-devel] [PATCH 03/13] libcamera: pipeline: Add method\n\tto prepare buffer for IPA","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Wed, 28 Aug 2019 16:01:17 -0000"}},{"id":2554,"web_url":"https://patchwork.libcamera.org/comment/2554/","msgid":"<20190829185731.GB8479@bigcity.dyn.berto.se>","date":"2019-08-29T18:57:31","subject":"Re: [libcamera-devel] [PATCH 03/13] libcamera: pipeline: Add method\n\tto prepare buffer for IPA","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Jacopo,\n\nThanks for your feedback.\n\nOn 2019-08-28 18:02:49 +0200, Jacopo Mondi wrote:\n> Hi Niklas,\n> \n> On Wed, Aug 28, 2019 at 03:17:00AM +0200, Niklas Söderlund wrote:\n> > The pipeline handlers dealing with buffers outside the request coming\n> > from an application needs to prepare Buffer objects before they can be\n> > used by other the libcamera functions. For objects coming from the user\n> > this is done by the Camera before the Buffers reach the pipeline\n> > handler. Add a new method prepareInternalBuffer() to aid with this\n> > preparation.\n> \n> As clarified offline, this should be reworded to specify you're here\n\nYes this should be reworded for v2.\n\n> talking about internal buffers used by pipelines for\n> statistics/controls (also for internal buffer queues, like the\n> CIO2->IMGU one in the IPU3 ? )\n\nIt could be used for the buffers between CIO2->IMGU indeed.\n\n> >\n> > Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n> > ---\n> >  src/libcamera/include/pipeline_handler.h |  2 ++\n> >  src/libcamera/pipeline_handler.cpp       | 18 ++++++++++++++++++\n> >  2 files changed, 20 insertions(+)\n> >\n> > diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\n> > index ffc7adb802215313..91d40ef40a465c4e 100644\n> > --- a/src/libcamera/include/pipeline_handler.h\n> > +++ b/src/libcamera/include/pipeline_handler.h\n> > @@ -98,6 +98,8 @@ protected:\n> >\n> >  \tCameraData *cameraData(const Camera *camera);\n> >\n> > +\tvoid prepareInternalBuffer(Buffer *buffer, Request *request,\n> > +\t\t\t\t   BufferMemory *mem);\n> \n> Do you think this will expand ? Otherwise I wonder if this should not\n> be made Buffer operation, like Buffer::prepare(req, mem); or other\n> names that better convey the idea of initialization\n> outside-of-a-request...\n\nI thought about adding this helper on the Buffer object directly, but \ndecided against it as it would then be exposed to applications. This is \nsomething we don't want as the sole user of this should be pipeline \nhandler implementations.\n\n> \n> \n> >  \tCameraManager *manager_;\n> >\n> >  private:\n> > diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\n> > index 89b67806597728f9..766fd496306ece9c 100644\n> > --- a/src/libcamera/pipeline_handler.cpp\n> > +++ b/src/libcamera/pipeline_handler.cpp\n> > @@ -484,6 +484,24 @@ void PipelineHandler::hotplugMediaDevice(MediaDevice *media)\n> >  \tmedia->disconnected.connect(this, &PipelineHandler::mediaDeviceDisconnected);\n> >  }\n> >\n> > +/**\n> > + * \\brief Prepare buffer for internal usage by a pipeline handler\n> > + * \\param[in,out] buffer The buffer to prepare\n> > + * \\param[in] request The request to associate the \\a buffer with\n> > + * \\param[in] mem The memory to associate the \\a buffer with\n> > + *\n> > + * Pipeline handlers creating internal buffers to facilitate data flow in the\n> > + * pipeline need to prepare the buffers by setting up the buffer object state.\n> > + * This function help pipeline handler implementations to perform this\n> > + * preparation.\n> > + */\n> > +void PipelineHandler::prepareInternalBuffer(Buffer *buffer, Request *request,\n> > +\t\t\t\t\t    BufferMemory *mem)\n> > +{\n> > +\tbuffer->request_ = request;\n> > +\tbuffer->mem_ = mem;\n> > +}\n> > +\n> >  /**\n> >   * \\brief Slot for the MediaDevice disconnected signal\n> >   */\n> > --\n> > 2.22.1\n> >\n> > _______________________________________________\n> > libcamera-devel mailing list\n> > libcamera-devel@lists.libcamera.org\n> > https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x236.google.com (mail-lj1-x236.google.com\n\t[IPv6:2a00:1450:4864:20::236])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 99B4560BE5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 29 Aug 2019 20:57:33 +0200 (CEST)","by mail-lj1-x236.google.com with SMTP id x4so4077413ljj.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 29 Aug 2019 11:57:33 -0700 (PDT)","from localhost (h-177-236.A463.priv.bahnhof.se. [217.31.177.236])\n\tby smtp.gmail.com with ESMTPSA id\n\tr8sm516814lfc.39.2019.08.29.11.57.31\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 29 Aug 2019 11:57:31 -0700 (PDT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to\n\t:user-agent; bh=A9EfOO652F8/RhceaQSrcTI7VCFqsJcIXFZKZypPg5E=;\n\tb=h2MF+XYh/CzYmTQLDL7gD7/95BUyX7N9Z/iWL+uA3pwGjJE5KQnkFeoVoFlVCbfQQG\n\th0424Ic91q5bq8glp4x732K7//HrNzCxfk1+KKec3Dz/UgoGeoKg/0noN61eshuFYfcT\n\tYjE5+Qy9UbbBFHwCEP433jtGE+GQPF2Imo7/X4sv9HCBX5LgMRqWCspBVvrsGWZE+Nt5\n\tawItLvYXPuCKA9XJ/s7qUa+lSAvXOYVJB3nyKX2gHFNfeie7eCGHZ9bzDt9JFj3Ts91I\n\tkQLeDhU9LrQB9w4OxO/OPeZ10ElkUkLdLypr6Hn4+pL8+s9pE+La+3LxAHIZdR5PFHZ6\n\tu25Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to:user-agent;\n\tbh=A9EfOO652F8/RhceaQSrcTI7VCFqsJcIXFZKZypPg5E=;\n\tb=iZ6aNUM0b8UnvoSCDR+hknfDLXxc+r6aIfIprnb9ph5v6cewxG0UxGUvvE3grPH1kV\n\t+jOG7+OD5B3k9G8RRC5lVKNaFtxp8ofsEqFsQPT87ggeIDVUY3O4OnIuJW9zUSD/E+hY\n\tZulEhBWRxT5gCfNim5xhRY9fguQYWj0APStCSnq73/MLrvWxkn7Ac573BsieWP+2yMuV\n\txLvs10iEPX6N+H65mZB/3ahxL8w2goZP/I2IHW0VnAEfzhDNkRPJacyzJHYr81SeZ2dY\n\tQNH90wg829DuMY3hZvKgSyYfFmZMwtfi8DHFN0ItKbj9MSnd42GSAVy/I49TOv70aZvn\n\tx3kQ==","X-Gm-Message-State":"APjAAAV+Dskf7UpYk5E09j201Nzn0eAigmsHQ78oiJKturhKA6Y0+2Mk\n\tbNqNAtwaj4YvK7PYxwnlC1gMt3bBdcg=","X-Google-Smtp-Source":"APXvYqwZMw22Da2TPTpjHI7iSomjXdQB2LoqM+BOnVzF4dLjmiE3JilMCPyxhu9PVxD6xrwRkfinJA==","X-Received":"by 2002:a2e:3c12:: with SMTP id j18mr297582lja.50.1567105052570; \n\tThu, 29 Aug 2019 11:57:32 -0700 (PDT)","Date":"Thu, 29 Aug 2019 20:57:31 +0200","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20190829185731.GB8479@bigcity.dyn.berto.se>","References":"<20190828011710.32128-1-niklas.soderlund@ragnatech.se>\n\t<20190828011710.32128-4-niklas.soderlund@ragnatech.se>\n\t<20190828160249.ydypobhuj4lt6mfk@uno.localdomain>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20190828160249.ydypobhuj4lt6mfk@uno.localdomain>","User-Agent":"Mutt/1.12.1 (2019-06-15)","Subject":"Re: [libcamera-devel] [PATCH 03/13] libcamera: pipeline: Add method\n\tto prepare buffer for IPA","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.23","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":"Thu, 29 Aug 2019 18:57:33 -0000"}}]