Patch Detail
Show a patch.
GET /api/1.1/patches/18497/?format=api
{ "id": 18497, "url": "https://patchwork.libcamera.org/api/1.1/patches/18497/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18497/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20230331072341.24851-2-naush@raspberrypi.com>", "date": "2023-03-31T07:23:32", "name": "[libcamera-devel,v3,01/10] ipa: raspberrypi Store the target string in the controller", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "9046fb89854350feb8ec85427b193689118e73e8", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18497/mbox/", "series": [ { "id": 3830, "url": "https://patchwork.libcamera.org/api/1.1/series/3830/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3830", "date": "2023-03-31T07:23:31", "name": "Raspberry Pi: Generalised algorithms", "version": 3, "mbox": "https://patchwork.libcamera.org/series/3830/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18497/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18497/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 65D66C329C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 31 Mar 2023 07:40:51 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B17ED62750;\n\tFri, 31 Mar 2023 09:40:49 +0200 (CEST)", "from mail-io1-xd35.google.com (mail-io1-xd35.google.com\n\t[IPv6:2607:f8b0:4864:20::d35])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AB6E9626E3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 31 Mar 2023 09:40:48 +0200 (CEST)", "by mail-io1-xd35.google.com with SMTP id e13so9411943ioc.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 31 Mar 2023 00:40:48 -0700 (PDT)", "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\ti17-20020a6bf411000000b0074555814e73sm421943iog.32.2023.03.31.00.40.46\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 31 Mar 2023 00:40:46 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1680248449;\n\tbh=yXfpIKnj1URDHAgm+r1nqvyD24jjrUtCCqmSkQhTkb4=;\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=pA6HbC5EoAI2L6wIPaMjRS5i7fioopDWO6Cs3IUTnWpqyRq1H+EvJQhT2aN8opJdJ\n\twM8i3dXMEkjTUNStDGvnF4KDcNH/7GEo5o/vYFalpb896yvooO8GJ+uqdnkoRshBRs\n\tVHKjNSn44OY3LY5d6zXLkN4oLakgj1GXaAeJJUWiCPwcnhQEPK25Ll/fZ7i9j2NGii\n\tu0pgsRU69QjPWywXENLHsfrywMqxbuwEyprgB3Z69EKrhZdHQbbonuhjKPoPTKOaa5\n\tEZNVhyXC4T0NQghnIDNRE+3TdJt3lpXwtnAITPXio0TQQYbBA8zpIAPClwW4xKWmpn\n\tgzNJl1aCpdqHQ==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1680248447;\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=r1xDF00lIPNyXEShIbWt3BBCmUdK67y4koidjVf0DD8=;\n\tb=GHiiJmciwIfMRTfaCtIYrnCybf46IQmtovsIuf4R+AhRxXbRzbhm1xbuusc3UZeuVn\n\tO5kCS5QEwKAJxtbhyDGKRIEKj7EDs3AAPMuTnO3v+YRvxKk7Wh4zPEHeYGPmuGLjWqAL\n\tlryDDFgF3r4v4hfD+ji/tQ8QeOzZQ+lBG5kH7qRnub44cW9zXoM8g4yNvy2E6hYoq4sx\n\tMe4FtvOqILoCJVwM6qe/PP862Sz6J6xB+4FpvPx48sKiGqeHlUNY6V0x3w14NCf9lrIO\n\tSS5IIBcgxuiMCcKHlJ6U4tllqqxMyN/MKQzhVdFZ4WkP4c0z1/8QPIHj3ptXv6iPLFlG\n\t9x2w==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"GHiiJmci\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112; t=1680248447;\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=r1xDF00lIPNyXEShIbWt3BBCmUdK67y4koidjVf0DD8=;\n\tb=75z/ZJv1/89m6S/Z+96mtVhc9/VAk4AG4g/h2UTWiqgOOYX8RpuBAk3Ln4VpVafN+z\n\ttD7RUH6OPhlReGL4NArqkGvP8O0pJf6+8dmO8+1nG8DZsihNIM2PnVoF3GpC9cHkUAT8\n\tu1SKbjarFWJCmPwTes5df4NwNAB2Qrqm8baDF/PuXvZfxB83bD8I1cSb8cmtntzOqbTP\n\tSDUTaFvHsBf0xXdkrVOqMVc0g/Dilly/ZpkOIe0rS4cOHKbwX9T6qh1LlgJ4ZZFdgLk2\n\twdQAeA0k0FWCeiEm6KYbCWeVQPBaifAjbN+eQNnCrqSvxzqbBv1b1ACXtMofu8lIPILJ\n\t2Oqw==", "X-Gm-Message-State": "AO0yUKUG17bSSsHLmlXr/6oWhTc3Qx8jArjZTiI2nEBzVu/2lrKHBGPz\n\thXzt5Pxt5b+nnC/bG7RRqz2C4GT27+PYEon29fKWEg==", "X-Google-Smtp-Source": "AK7set9lpzviuVgXZHnVWiK+Dvc7IJrazBarYnRhM8NnFVpP3YHciazlEpFxvsWv/Loc0FT3+N2ooQ==", "X-Received": "by 2002:a6b:6101:0:b0:71b:5cd7:fcd9 with SMTP id\n\tv1-20020a6b6101000000b0071b5cd7fcd9mr17957551iob.20.1680248447108; \n\tFri, 31 Mar 2023 00:40:47 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 31 Mar 2023 08:23:32 +0100", "Message-Id": "<20230331072341.24851-2-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20230331072341.24851-1-naush@raspberrypi.com>", "References": "<20230331072341.24851-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 01/10] ipa: raspberrypi Store the\n\ttarget string in the controller", "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": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The target string may be used by algorithms to determine the running\nhardware target.\n\nStore the target string provided by the camera tuning files in the\ncontroller state. Add a getTarget() member function to retrieve this\nstring.\n\nValidate the correct hardware target (\"bcm2835\") during the IPA\ninitialisation phase.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/ipa/raspberrypi/controller/algorithm.h | 4 ++++\n src/ipa/raspberrypi/controller/controller.cpp | 6 ++++++\n src/ipa/raspberrypi/controller/controller.h | 4 ++++\n src/ipa/raspberrypi/raspberrypi.cpp | 8 ++++++++\n 4 files changed, 22 insertions(+)", "diff": "diff --git a/src/ipa/raspberrypi/controller/algorithm.h b/src/ipa/raspberrypi/controller/algorithm.h\nindex 4f3275987305..7c22fbe4945c 100644\n--- a/src/ipa/raspberrypi/controller/algorithm.h\n+++ b/src/ipa/raspberrypi/controller/algorithm.h\n@@ -41,6 +41,10 @@ public:\n \t{\n \t\treturn controller_->getGlobalMetadata();\n \t}\n+\tconst std::string &getTarget() const\n+\t{\n+\t\treturn controller_->getTarget();\n+\t}\n \n private:\n \tController *controller_;\ndiff --git a/src/ipa/raspberrypi/controller/controller.cpp b/src/ipa/raspberrypi/controller/controller.cpp\nindex e91567852d00..a6250ee140b0 100644\n--- a/src/ipa/raspberrypi/controller/controller.cpp\n+++ b/src/ipa/raspberrypi/controller/controller.cpp\n@@ -38,6 +38,7 @@ int Controller::read(char const *filename)\n \n \tstd::unique_ptr<YamlObject> root = YamlParser::parse(file);\n \tdouble version = (*root)[\"version\"].get<double>(1.0);\n+\ttarget_ = (*root)[\"target\"].get<std::string>(\"bcm2835\");\n \n \tif (version < 2.0) {\n \t\tLOG(RPiController, Warning)\n@@ -142,3 +143,8 @@ Algorithm *Controller::getAlgorithm(std::string const &name) const\n \t}\n \treturn nullptr;\n }\n+\n+const std::string &Controller::getTarget() const\n+{\n+\treturn target_;\n+}\ndiff --git a/src/ipa/raspberrypi/controller/controller.h b/src/ipa/raspberrypi/controller/controller.h\nindex e6c950c3a509..24e02903d438 100644\n--- a/src/ipa/raspberrypi/controller/controller.h\n+++ b/src/ipa/raspberrypi/controller/controller.h\n@@ -46,6 +46,7 @@ public:\n \tvoid process(StatisticsPtr stats, Metadata *imageMetadata);\n \tMetadata &getGlobalMetadata();\n \tAlgorithm *getAlgorithm(std::string const &name) const;\n+\tconst std::string &getTarget() const;\n \n protected:\n \tint createAlgorithm(const std::string &name, const libcamera::YamlObject ¶ms);\n@@ -53,6 +54,9 @@ protected:\n \tMetadata globalMetadata_;\n \tstd::vector<AlgorithmPtr> algorithms_;\n \tbool switchModeCalled_;\n+\n+private:\n+\tstd::string target_;\n };\n \n } /* namespace RPiController */\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 66a020d022cd..92c65a2c2f6c 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -266,6 +266,14 @@ int IPARPi::init(const IPASettings &settings, bool lensPresent, IPAInitResult *r\n \t\treturn ret;\n \t}\n \n+\tconst std::string &target = controller_.getTarget();\n+\tif (target != \"bcm2835\") {\n+\t\tLOG(IPARPI, Error)\n+\t\t\t<< \"Tuning data file target returned \\\"\" << target << \"\\\"\"\n+\t\t\t<< \", expected \\\"bcm2835\\\"\";\n+\t\treturn -EINVAL;\n+\t}\n+\n \tlensPresent_ = lensPresent;\n \n \tcontroller_.initialise();\n", "prefixes": [ "libcamera-devel", "v3", "01/10" ] }