{"id":18178,"url":"https://patchwork.libcamera.org/api/1.1/patches/18178/?format=json","web_url":"https://patchwork.libcamera.org/patch/18178/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20230123154934.27803-4-naush@raspberrypi.com>","date":"2023-01-23T15:49:23","name":"[libcamera-devel,v2,03/14] pipeline: ipa: raspberrypi: Replace entityControls","commit_ref":"c204a67bae262945cf5455e475e79a6b626a7827","pull_url":null,"state":"accepted","archived":false,"hash":"f02809680cdd634d976944e4c036cc10e1bac481","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/18178/mbox/","series":[{"id":3719,"url":"https://patchwork.libcamera.org/api/1.1/series/3719/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3719","date":"2023-01-23T15:49:20","name":"Raspberry Pi: Camera Module 3 support","version":2,"mbox":"https://patchwork.libcamera.org/series/3719/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/18178/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/18178/checks/","tags":{},"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 6F20FBEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 23 Jan 2023 15:49:54 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CEFA9625EE;\n\tMon, 23 Jan 2023 16:49:52 +0100 (CET)","from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com\n\t[IPv6:2a00:1450:4864:20::32d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9959E625D8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Jan 2023 16:49:49 +0100 (CET)","by mail-wm1-x32d.google.com with SMTP id m15so9369177wms.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 23 Jan 2023 07:49:49 -0800 (PST)","from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tn16-20020a05600c181000b003d1de805de5sm10339689wmp.16.2023.01.23.07.49.48\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 23 Jan 2023 07:49:48 -0800 (PST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674488992;\n\tbh=xfPh4Disv4iEifN3/oiLgQOVZPel27wJl9JloUjFs6w=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=v0DOmZNl7nAOqU5c04w4uTvBlI8AlWytRkUqe2yVT0vphmY6ML9yKIquMpjHZXMId\n\tl1dNncS6Lcfzk0hxdskTmJc311sXt5aqGhQW2LdsOoN4ErQMGIwE//5DbxtDGMMKj3\n\tsOV+vo/gAmKJ5bUaVMhOIqvyLZJb/HeK4H+2r0e0YYncOJwIYtloKfUYf+J2Zrrqod\n\toDDQRCvfxYXteq19xhixR2ZEBRPcmXpvRnBglg5bKjN51fEsT6SmclpUaK3eHI0JHk\n\tbkOOfjXrCR0RO6C1CEeF/44g568NeutCSy8LKOx8VjafEQvLM0QYAYxid/6Unoykf6\n\tFducx15+5Rohg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=ezly2RwbrTh/0/n2/4eff8d0vIHmHXT728mYO/WrJoo=;\n\tb=rzco2uSLzQhu5bETsCie4Lt7cps+kM9mbYk4RkLOCNSEku0GoB3HAVvkcNi6pYWFS8\n\tivh+eSykBrWZUtgylSz68yS/i42FwY4+0nbwzhGqMosAvww6QNtLK9xE2lDDSa4M6XYE\n\tTFZrVcz754kgmTbS2waSCwODfJhfMPM8yPLQ1PehgKHOm15o6PJhQ87koI7sErLTYMaP\n\tEGqpUDUKQ4QoVtlyCKc6Ud6HwPKLEJs65zzC7U+UD1gft7dUIrwn70zi9jj801gff3CU\n\ti4NLOp+jKSXTVM5PTzZqKxlG3s6yT0f+acqlgZbj0CTFsVFnoQz8DQMqEJj5kOeEvK9b\n\tq35A=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"rzco2uSL\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=ezly2RwbrTh/0/n2/4eff8d0vIHmHXT728mYO/WrJoo=;\n\tb=cgueY9FTRgxd/K50dLCTwTjoqbiZY1objKVr+2BPvOQ8CyuKCGSKecvVSL5W43QKbg\n\tMcHLJbU4aCRWZ6ibgLSlbUeLbx7kwqJSL2n2FnIeAKszD7KaQDKPMH6m6guskvWY8liE\n\t2/vT376IAZ9tVcTbopKomThDVdPqINSMNsUTp66huSUv1zpiit82pPBg0x2KXi5gVe7l\n\tPpA9WhmefYAtpRMWNiZph48raYL8xlFiLhUt9+xoQsd8mkZg7u+W8UHXk+xVQAp7hsEm\n\tLsTVHAHcTZ7MJdOGKEhcfWJYAShHDDEhVqZ5aZPYdhPgvBYx+UAa49fBMtU8pUQWergA\n\tarnw==","X-Gm-Message-State":"AFqh2krxqNQi6peF+6cXHTFwrKtc9326bI/mXukoQIQhK5Rkra49e9hf\n\tUdqqF2/XQHrtdgDn+77qnZcWYjBoKLRJXFdzFgI=","X-Google-Smtp-Source":"AMrXdXuX1Q3Eko8QuPj/F7vOZKavApiRSJxVLuj5cVzNnNN5A5f4mH/FZ5lXwz8cAmRQfAN7H+FAhw==","X-Received":"by 2002:a05:600c:5028:b0:3db:1dea:75c9 with SMTP id\n\tn40-20020a05600c502800b003db1dea75c9mr16531071wmr.28.1674488989077; \n\tMon, 23 Jan 2023 07:49:49 -0800 (PST)","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 23 Jan 2023 15:49:23 +0000","Message-Id":"<20230123154934.27803-4-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20230123154934.27803-1-naush@raspberrypi.com>","References":"<20230123154934.27803-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 03/14] pipeline: ipa: raspberrypi:\n\tReplace entityControls","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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Replace the legacy entityControls map passed into ipa::configure() with explicit\nfields for sensor and ISP controls. This removes any ambiguity over which set of\ncontrols corresponds with specific integer keys.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n include/libcamera/ipa/raspberrypi.mojom         |  4 ++--\n src/ipa/raspberrypi/raspberrypi.cpp             | 17 ++++-------------\n .../pipeline/raspberrypi/raspberrypi.cpp        |  7 +++----\n 3 files changed, 9 insertions(+), 19 deletions(-)","diff":"diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\nindex 0732496968ed..2a4821fbc0ef 100644\n--- a/include/libcamera/ipa/raspberrypi.mojom\n+++ b/include/libcamera/ipa/raspberrypi.mojom\n@@ -36,6 +36,8 @@ struct ISPConfig {\n struct IPAConfig {\n \tuint32 transform;\n \tlibcamera.SharedFD lsTableHandle;\n+\tlibcamera.ControlInfoMap sensorControls;\n+\tlibcamera.ControlInfoMap ispControls;\n };\n \n struct IPAConfigResult {\n@@ -59,7 +61,6 @@ interface IPARPiInterface {\n \t * \\fn configure()\n \t * \\brief Configure the IPA stream and sensor settings\n \t * \\param[in] sensorInfo Camera sensor information\n-\t * \\param[in] entityControls Controls provided by the pipeline entities\n \t * \\param[in] ipaConfig Pipeline-handler-specific configuration data\n \t * \\param[out] controls Controls to apply by the pipeline entity\n \t * \\param[out] result Other results that the pipeline handler may require\n@@ -74,7 +75,6 @@ interface IPARPiInterface {\n \t * pipeline handler to the IPA and back.\n \t */\n \tconfigure(libcamera.IPACameraSensorInfo sensorInfo,\n-\t\t  map<uint32, libcamera.ControlInfoMap> entityControls,\n \t\t  IPAConfig ipaConfig)\n \t\t=> (int32 ret, libcamera.ControlList controls, IPAConfigResult result);\n \ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex f748b6e2dac7..aa18ed750370 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -119,9 +119,7 @@ public:\n \tvoid start(const ControlList &controls, StartConfig *startConfig) override;\n \tvoid stop() override {}\n \n-\tint configure(const IPACameraSensorInfo &sensorInfo,\n-\t\t      const std::map<unsigned int, ControlInfoMap> &entityControls,\n-\t\t      const IPAConfig &data,\n+\tint configure(const IPACameraSensorInfo &sensorInfo, const IPAConfig &data,\n \t\t      ControlList *controls, IPAConfigResult *result) override;\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n@@ -380,18 +378,11 @@ void IPARPi::setMode(const IPACameraSensorInfo &sensorInfo)\n \tmode_.sensitivity = helper_->getModeSensitivity(mode_);\n }\n \n-int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,\n-\t\t      const std::map<unsigned int, ControlInfoMap> &entityControls,\n-\t\t      const IPAConfig &ipaConfig,\n+int IPARPi::configure(const IPACameraSensorInfo &sensorInfo, const IPAConfig &ipaConfig,\n \t\t      ControlList *controls, IPAConfigResult *result)\n {\n-\tif (entityControls.size() != 2) {\n-\t\tLOG(IPARPI, Error) << \"No ISP or sensor controls found.\";\n-\t\treturn -1;\n-\t}\n-\n-\tsensorCtrls_ = entityControls.at(0);\n-\tispCtrls_ = entityControls.at(1);\n+\tsensorCtrls_ = ipaConfig.sensorControls;\n+\tispCtrls_ = ipaConfig.ispControls;\n \n \tif (!validateSensorControls()) {\n \t\tLOG(IPARPI, Error) << \"Sensor control validation failed.\";\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 272767b5263b..9dd36cbaea78 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1615,8 +1615,8 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::IPA\n \tstd::map<unsigned int, ControlInfoMap> entityControls;\n \tipa::RPi::IPAConfig ipaConfig;\n \n-\tentityControls.emplace(0, sensor_->controls());\n-\tentityControls.emplace(1, isp_[Isp::Input].dev()->controls());\n+\tipaConfig.sensorControls = sensor_->controls();\n+\tipaConfig.ispControls = isp_[Isp::Input].dev()->controls();\n \n \t/* Always send the user transform to the IPA. */\n \tipaConfig.transform = static_cast<unsigned int>(config->transform);\n@@ -1644,8 +1644,7 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config, ipa::RPi::IPA\n \n \t/* Ready the IPA - it must know about the sensor resolution. */\n \tControlList controls;\n-\tret = ipa_->configure(sensorInfo_, entityControls, ipaConfig,\n-\t\t\t      &controls, result);\n+\tret = ipa_->configure(sensorInfo_, ipaConfig, &controls, result);\n \tif (ret < 0) {\n \t\tLOG(RPI, Error) << \"IPA configuration failed!\";\n \t\treturn -EPIPE;\n","prefixes":["libcamera-devel","v2","03/14"]}