[{"id":16362,"web_url":"https://patchwork.libcamera.org/comment/16362/","msgid":"<CAEmqJPoESuRVTidoC_5Vw92fua5xA6kjZYssmMpifWayjZvcgg@mail.gmail.com>","date":"2021-04-19T13:58:01","subject":"Re: [libcamera-devel] [PATCH 09/13] libcamera: raspberrypi: Do not\n\tover-write metadata","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Jacopo,\n\nThank you for your work.\n\nOn Mon, 19 Apr 2021 at 14:14, Jacopo Mondi <jacopo@jmondi.org> wrote:\n\n> This commit applies to the RaspberryPi pipeline handler the same change\n> applied to IPU3 in commit 13a7ed7b1f1f (\"libcamera: ipu3: Do not\n> over-write metadata\").\n>\n> When a Request is completed upon receiving the IPA produced metadata,\n> the metadata associated with the Request are over-written, deleting\n> the information set at output buffer completion, such as the\n> SensorTimestamp.\n>\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n>\n---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 10 ++++++++--\n>  1 file changed, 8 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index f22e286ed87a..d1902bfc3393 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -1312,9 +1312,15 @@ void RPiCameraData::statsMetadataComplete(uint32_t\n> bufferId, const ControlList &\n>\n>         handleStreamBuffer(buffer, &isp_[Isp::Stats]);\n>\n> -       /* Fill the Request metadata buffer with what the IPA has provided\n> */\n> +       /*\n> +        * Add to the Request metadata buffer what the IPA has provided.\n> +        *\n> +        * Do not overwrite controls set by the pipeline handler, in\n> example\n>\n\ns/in example/for example/?\n\nApart from that,\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n\n> +        * SensorTimestamp.\n> +        */\n>         Request *request = requestQueue_.front();\n> -       request->metadata() = controls;\n> +       for (const auto &ctrl : controls)\n> +               request->metadata().set(ctrl.first, ctrl.second);\n>\n>         /*\n>          * Also update the ScalerCrop in the metadata with what we actually\n> --\n> 2.31.1\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel\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 AB068BD814\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 19 Apr 2021 13:58:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 33E8F6883A;\n\tMon, 19 Apr 2021 15:58:19 +0200 (CEST)","from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com\n\t[IPv6:2a00:1450:4864:20::12a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9699568824\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 Apr 2021 15:58:17 +0200 (CEST)","by mail-lf1-x12a.google.com with SMTP id r128so29114048lff.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 Apr 2021 06:58:17 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"oN9eot5Q\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=WmfzBocDWB9Jr5X/MLoIDk6x2MCLhw6euFEtZmG/BdE=;\n\tb=oN9eot5Q9WwtD14Kv1XAYMF8d04bnLIA/ejJs1pu15KSdQQWB1CLFRdx/yA3XLotmT\n\t0zAH6wosP2kvXHfDoBne2wpyJniFSc/1O3qh7Hxl+QwFJ8jt7knozS5OdkyUv6egc0mF\n\tGDezN898QOjKXPyM/WZ/kuOWqW+1zS3B5fXBoP8WSP3uPdQ/F/gYuOabNgtO7Rg9HZiM\n\tHU99kVrlPqOilEA6ttv03Z/eR/p10CbPD7OVmtH95X+qbce5a5AC3hCif56rBj1K9pr3\n\tdnISexbEtOo+UfybYFcKeCFVUtds8QBc4+E+eBGAxK82Z7uPvWlQJ+G/8WfdQBdQrH6/\n\t5PwQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=WmfzBocDWB9Jr5X/MLoIDk6x2MCLhw6euFEtZmG/BdE=;\n\tb=KqVmLqGz4wzN7rJg2xJMnaXKa5EU37v5zrNSHGPEFVcnnrXsYmrcAxeR883CAgSvQf\n\ta2u2kAzYq87MwtG+Z878UPfu4mvQYxSjRMMRzse6fadVoHC/vXi/gU81voxeFta/NUmw\n\tW/9U2WJ5ijqRskSwFLxfrUsgsT5k+k2TaizDM4d6FEFMhaiVD3VYFojGPltJoDowZ2m5\n\tOFDQ7z/yAPegawUBprV8P63msLOAK9Im5LOwRXSfI75C7H2wpjPyCCb9m6fJvpyuYG/Y\n\tP6yPSFbA0Df73C7i/xPX4B0p6gvlOexh5W0hrT2V0keFmkxSCu0s+Csq8UKP4YhqgRT+\n\twRng==","X-Gm-Message-State":"AOAM532XT585O6JTQnRspc4YTsZExHrQh6c1+OKkJaX6RX1KcGBePwFO\n\tSf950yjcEgeJ01Hc0IUOe8vARWfcUSR53YWpEptv7w==","X-Google-Smtp-Source":"ABdhPJyb93jMdlf4LePJ0wjBNl9ZY7grX/rwmLimqLYZRjIbrjBqMC63O17F7xv8jYPnrm0+ye/FSUHMi3znHmwKQC4=","X-Received":"by 2002:a05:6512:11cc:: with SMTP id\n\th12mr12265032lfr.567.1618840697098; \n\tMon, 19 Apr 2021 06:58:17 -0700 (PDT)","MIME-Version":"1.0","References":"<20210419131433.22920-1-jacopo@jmondi.org>\n\t<20210419131433.22920-10-jacopo@jmondi.org>","In-Reply-To":"<20210419131433.22920-10-jacopo@jmondi.org>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Mon, 19 Apr 2021 14:58:01 +0100","Message-ID":"<CAEmqJPoESuRVTidoC_5Vw92fua5xA6kjZYssmMpifWayjZvcgg@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 09/13] libcamera: raspberrypi: Do not\n\tover-write metadata","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Content-Type":"multipart/mixed;\n\tboundary=\"===============5235379058338774690==\"","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":16410,"web_url":"https://patchwork.libcamera.org/comment/16410/","msgid":"<YH9NrDfTrzIiHC1r@pendragon.ideasonboard.com>","date":"2021-04-20T21:54:52","subject":"Re: [libcamera-devel] [PATCH 09/13] libcamera: raspberrypi: Do not\n\tover-write metadata","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 Mon, Apr 19, 2021 at 03:14:29PM +0200, Jacopo Mondi wrote:\n> This commit applies to the RaspberryPi pipeline handler the same change\n> applied to IPU3 in commit 13a7ed7b1f1f (\"libcamera: ipu3: Do not\n> over-write metadata\").\n> \n> When a Request is completed upon receiving the IPA produced metadata,\n> the metadata associated with the Request are over-written, deleting\n> the information set at output buffer completion, such as the\n> SensorTimestamp.\n\nThe change looks good, but may be implemented on top of\nControlList::merge().\n\n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 10 ++++++++--\n>  1 file changed, 8 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> index f22e286ed87a..d1902bfc3393 100644\n> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n> @@ -1312,9 +1312,15 @@ void RPiCameraData::statsMetadataComplete(uint32_t bufferId, const ControlList &\n>  \n>  \thandleStreamBuffer(buffer, &isp_[Isp::Stats]);\n>  \n> -\t/* Fill the Request metadata buffer with what the IPA has provided */\n> +\t/*\n> +\t * Add to the Request metadata buffer what the IPA has provided.\n> +\t *\n> +\t * Do not overwrite controls set by the pipeline handler, in example\n> +\t * SensorTimestamp.\n> +\t */\n>  \tRequest *request = requestQueue_.front();\n> -\trequest->metadata() = controls;\n> +\tfor (const auto &ctrl : controls)\n> +\t\trequest->metadata().set(ctrl.first, ctrl.second);\n>  \n>  \t/*\n>  \t * Also update the ScalerCrop in the metadata with what we actually","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 240ADBDB16\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 20 Apr 2021 21:54:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D98E46883E;\n\tTue, 20 Apr 2021 23:54:58 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0AEF360516\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Apr 2021 23:54:57 +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 90BCB411;\n\tTue, 20 Apr 2021 23:54:56 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"m/xiLqS5\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1618955696;\n\tbh=7JN/e7lVnkUGJUz8dKQQcYWC71/llsWMuyL8bZvpT+Y=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=m/xiLqS549wTxVmz3ATISV5nDZvKxbcJlerEelpLwwBYcVRf/4/VR11+RxyNb13Rb\n\t13fQT8gctOTLM42irMvVVuYyZKXzAiWayQQkvXu97zsdpVIqjfGkNo2YyQFsGkHkDn\n\tjchnjk2qjx5XzBSFNjejYyueNQ7I01fjp0Qg7ER4=","Date":"Wed, 21 Apr 2021 00:54:52 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Message-ID":"<YH9NrDfTrzIiHC1r@pendragon.ideasonboard.com>","References":"<20210419131433.22920-1-jacopo@jmondi.org>\n\t<20210419131433.22920-10-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Disposition":"inline","In-Reply-To":"<20210419131433.22920-10-jacopo@jmondi.org>","Subject":"Re: [libcamera-devel] [PATCH 09/13] libcamera: raspberrypi: Do not\n\tover-write metadata","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>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]