[{"id":32715,"web_url":"https://patchwork.libcamera.org/comment/32715/","msgid":"<CAHW6GY+xZ+yd98gYXnHPbMXAjwtZKLVd0sZx_gOTXqqQeAFFJg@mail.gmail.com>","date":"2024-12-13T10:05:05","subject":"Re: [PATCH 2/6] ipa: rpi: Add erase()/eraseLocked() to\n\tRPiController::Metadata","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the patch.\n\nOn Fri, 13 Dec 2024 at 09:46, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\n> These function erases a key/value pair from the metadata object.\n\nAt the risk of nit-picking horribly...\ns/These function erases/These functions erase/\n\nBut otherwise\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nThanks!\nDavid\n\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  src/ipa/rpi/controller/metadata.h | 14 ++++++++++++++\n>  1 file changed, 14 insertions(+)\n>\n> diff --git a/src/ipa/rpi/controller/metadata.h b/src/ipa/rpi/controller/metadata.h\n> index eda4b59bca9a..62e54051f8f4 100644\n> --- a/src/ipa/rpi/controller/metadata.h\n> +++ b/src/ipa/rpi/controller/metadata.h\n> @@ -90,6 +90,12 @@ public:\n>                 data_.insert(other.data_.begin(), other.data_.end());\n>         }\n>\n> +       void erase(std::string const &tag)\n> +       {\n> +               std::scoped_lock lock(mutex_);\n> +               eraseLocked(tag);\n> +       }\n> +\n>         template<typename T>\n>         T *getLocked(std::string const &tag)\n>         {\n> @@ -110,6 +116,14 @@ public:\n>                 data_[tag] = std::forward<T>(value);\n>         }\n>\n> +       void eraseLocked(std::string const &tag)\n> +       {\n> +               auto it = data_.find(tag);\n> +               if (it == data_.end())\n> +                       return;\n> +               data_.erase(it);\n> +       }\n> +\n>         /*\n>          * Note: use of (lowercase) lock and unlock means you can create scoped\n>          * locks with the standard lock classes.\n> --\n> 2.43.0\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 C6AA7C32F0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 13 Dec 2024 10:05:18 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3681F67EED;\n\tFri, 13 Dec 2024 11:05:18 +0100 (CET)","from mail-qt1-x82d.google.com (mail-qt1-x82d.google.com\n\t[IPv6:2607:f8b0:4864:20::82d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 16163618AD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Dec 2024 11:05:17 +0100 (CET)","by mail-qt1-x82d.google.com with SMTP id\n\td75a77b69052e-46753242ef1so23513241cf.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Dec 2024 02:05:17 -0800 (PST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"THi9F8Lx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1734084316; x=1734689116;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=20avCs9zs92AZ6JpjxEQJdoQZyHeEHCMwXI3G+rvk6M=;\n\tb=THi9F8LxdGdIYc0FETC1oZtg/aQdy38vbPc9qE116qZ45UOZrNzZO3YmhqUIl44ZWi\n\tny/5PI0DZwWrIfCLcGSRNu2lRq8Adi3+uRL1M/tbDF/sxCg+sNb6/l7u/aLHrjpDXUlE\n\tpLXESH2paVDwfsMY6u5OxRKsQKoGMK4SajU1hJQKZNs7Wb3uYWkUnSFGaX8+YTabrBgT\n\tsfTCgdRMGNUxp4bIXw7zfz7nRbFMKN688PVFQfwNf+XIT+a0dQY2J7BlS72kBsXWnY4O\n\t+HA8UJBOqU7KFXrwyuYjQDMCjxyY79G6rLHSmI1kUUgkgNRvJlNwXf4pJulJBfWHk6aT\n\td8SQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1734084316; x=1734689116;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=20avCs9zs92AZ6JpjxEQJdoQZyHeEHCMwXI3G+rvk6M=;\n\tb=HTzy0mXgHcP5cqINWWn2b3yWG+oaf+NqMTNSnw1tMjfPUP/OmrGCP1y6OIfGkhIS2P\n\t/2cvhNzhFgE3ETFvWZcKgO/JWSp9vMRWH7WlPJ++xeZfmnYIuf03qfbRBgurROrVEzph\n\texGhiW3xsgZQI+hCEil4UHv3S/8Qy3lFDzmEiG5NbfUsWQWM7A+FK0am09HC+fiwTnhg\n\tof88uoc6WKJzYaiMTo1kgrK8jEltUGbvtGF2mR+AERx6cAO7iH5wgJ79EAVYcOojnHoe\n\tlAdXG2ZRT20S2Gj2cBI8NxnGif8rqLrPjNY9GjCU4VyuU9K3iqFNHaUUa3IJjC9+rwk8\n\t9NZQ==","X-Gm-Message-State":"AOJu0YzgPk9M93DHBVAVJJM/XwL0fkyLNuvq7N/TBU4g0jI9IzZ/iQta\n\tIH3WwxOfjqwfMqR3BnipFx/YLE7U7xOitofHp9nJZ2487566F1KpKL5sgu3K0ScA/zqDQJSy8dE\n\ta0IPGaVTAHe6hunFibiSK42NkoXRwdq0745bxG4LFWYTU5JOG0fg=","X-Gm-Gg":"ASbGncsZ00eaTcHGerpnOykbrRiegCnNawmyx8i9IahoNZWiGwYga3Ivja0NBgFNxy/\n\tm++CDb+RuNEpD1e6sa5Y0Ro2BE5/lbDrfjRblfQ==","X-Google-Smtp-Source":"AGHT+IEacbiy3B1sqatv5lUaUJB9koiDsJTVqvC48xVmSGtDiGiLKdpUpom7Psmy65b12pZm0aQpn64slmgvdZYMuGc=","X-Received":"by 2002:a05:622a:580f:b0:467:6fa1:9e2a with SMTP id\n\td75a77b69052e-467a57fb30cmr38157981cf.40.1734084316098;\n\tFri, 13 Dec 2024 02:05:16 -0800 (PST)","MIME-Version":"1.0","References":"<20241213094602.2083174-1-naush@raspberrypi.com>\n\t<20241213094602.2083174-3-naush@raspberrypi.com>","In-Reply-To":"<20241213094602.2083174-3-naush@raspberrypi.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Fri, 13 Dec 2024 10:05:05 +0000","Message-ID":"<CAHW6GY+xZ+yd98gYXnHPbMXAjwtZKLVd0sZx_gOTXqqQeAFFJg@mail.gmail.com>","Subject":"Re: [PATCH 2/6] ipa: rpi: Add erase()/eraseLocked() to\n\tRPiController::Metadata","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":32727,"web_url":"https://patchwork.libcamera.org/comment/32727/","msgid":"<20241215153529.GB9975@pendragon.ideasonboard.com>","date":"2024-12-15T15:35:29","subject":"Re: [PATCH 2/6] ipa: rpi: Add erase()/eraseLocked() to\n\tRPiController::Metadata","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Dec 13, 2024 at 10:05:05AM +0000, David Plowman wrote:\n> Hi Naush\n> \n> Thanks for the patch.\n> \n> On Fri, 13 Dec 2024 at 09:46, Naushir Patuck <naush@raspberrypi.com> wrote:\n> >\n> > These function erases a key/value pair from the metadata object.\n> \n> At the risk of nit-picking horribly...\n> s/These function erases/These functions erase/\n> \n> But otherwise\n> \n> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> >\n> > Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> > ---\n> >  src/ipa/rpi/controller/metadata.h | 14 ++++++++++++++\n> >  1 file changed, 14 insertions(+)\n> >\n> > diff --git a/src/ipa/rpi/controller/metadata.h b/src/ipa/rpi/controller/metadata.h\n> > index eda4b59bca9a..62e54051f8f4 100644\n> > --- a/src/ipa/rpi/controller/metadata.h\n> > +++ b/src/ipa/rpi/controller/metadata.h\n> > @@ -90,6 +90,12 @@ public:\n> >                 data_.insert(other.data_.begin(), other.data_.end());\n> >         }\n> >\n> > +       void erase(std::string const &tag)\n> > +       {\n> > +               std::scoped_lock lock(mutex_);\n> > +               eraseLocked(tag);\n> > +       }\n> > +\n> >         template<typename T>\n> >         T *getLocked(std::string const &tag)\n> >         {\n> > @@ -110,6 +116,14 @@ public:\n> >                 data_[tag] = std::forward<T>(value);\n> >         }\n> >\n> > +       void eraseLocked(std::string const &tag)\n> > +       {\n> > +               auto it = data_.find(tag);\n> > +               if (it == data_.end())\n> > +                       return;\n> > +               data_.erase(it);\n> > +       }\n> > +\n> >         /*\n> >          * Note: use of (lowercase) lock and unlock means you can create scoped\n> >          * locks with the standard lock classes.","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 6CC1FC32F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 15 Dec 2024 15:35:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CEB0967F03;\n\tSun, 15 Dec 2024 16:35:47 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5861767EEE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 15 Dec 2024 16:35:46 +0100 (CET)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 47EB9A57;\n\tSun, 15 Dec 2024 16:35:10 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Abt3lsJE\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1734276910;\n\tbh=xUAY2xZppAeVotw35pbkG1cgWFoFKVtZrLzQvjfr5uI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Abt3lsJEhQTYnP2uDhh+inn0nehDyyvNK0AoFq9Lvzq/z3yll65IXV9bYxH/dA5Rt\n\tfDWPP0+47icWgWGI2shUsRQtA+8tGwE4+PlM3WMOWQyZUqsvWyZ1ubTNsowkrWtCit\n\tNVFBvu6K4yH8aPE6LW31pEFK8uwOIkyccqNZBvhs=","Date":"Sun, 15 Dec 2024 17:35:29 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 2/6] ipa: rpi: Add erase()/eraseLocked() to\n\tRPiController::Metadata","Message-ID":"<20241215153529.GB9975@pendragon.ideasonboard.com>","References":"<20241213094602.2083174-1-naush@raspberrypi.com>\n\t<20241213094602.2083174-3-naush@raspberrypi.com>\n\t<CAHW6GY+xZ+yd98gYXnHPbMXAjwtZKLVd0sZx_gOTXqqQeAFFJg@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAHW6GY+xZ+yd98gYXnHPbMXAjwtZKLVd0sZx_gOTXqqQeAFFJg@mail.gmail.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]