Patch Detail
Show a patch.
GET /api/patches/18550/?format=api
{ "id": 18550, "url": "https://patchwork.libcamera.org/api/patches/18550/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18550/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20230426131057.21550-3-naush@raspberrypi.com>", "date": "2023-04-26T13:10:46", "name": "[libcamera-devel,02/13] libcamera: ipa_proxy: Allow a prefix for the configuration file", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "efc1a4149e0a57d8fa6200be3aadc73287a21f33", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18550/mbox/", "series": [ { "id": 3847, "url": "https://patchwork.libcamera.org/api/series/3847/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3847", "date": "2023-04-26T13:10:44", "name": "Raspberry Pi: Code refactoring", "version": 1, "mbox": "https://patchwork.libcamera.org/series/3847/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18550/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18550/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 D9B82BDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 Apr 2023 13:13:16 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 89D33627E9;\n\tWed, 26 Apr 2023 15:13:15 +0200 (CEST)", "from mail-wm1-x331.google.com (mail-wm1-x331.google.com\n\t[IPv6:2a00:1450:4864:20::331])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3C611627D6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Apr 2023 15:13:13 +0200 (CEST)", "by mail-wm1-x331.google.com with SMTP id\n\t5b1f17b1804b1-3f1957e80a2so151866845e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Apr 2023 06:13:13 -0700 (PDT)", "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tk5-20020adff5c5000000b002f103ca90cdsm15780949wrp.101.2023.04.26.06.13.10\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 26 Apr 2023 06:13:11 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1682514795;\n\tbh=1gxU4JwyGxJEnRQ9vp8hr7LGZOljBhaDc83/JCtpisc=;\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:\n\tFrom;\n\tb=sW28jg7HQpQZVQS8uz0A9zBQuXyJm4naxHYN4OXsm5hBsiYA3/M+XthoCLkfqVqFp\n\tvznAXqG7F4V0Xvao99TfVaOfEvlrpNJMlOSwVLfipYNl94GOlzuCbojmOvd698TFEv\n\th/hz9NlOvs8TaxKOUbkInfGIkL0i4Zyoh6XPBbnaSZgpR7nKdKSouAyb0iHjZSra21\n\tBeBfQed9D8oTqvOllJo8YConbWg0bvEUn+5gSIzlri5I4xDvvCwp4UwzIVwi8f1ekJ\n\tpct287blQWY3V7+trFfg3qnIYW6BPleJfJEHfCJuiG1wjwxxA4VRfpOeNajqMl8VlN\n\tVY5nZkptdD9lQ==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1682514792; x=1685106792;\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=zoLEOeoTgZgHTXVqtppZR4khc2YZ0Sk1+YlJyvlS/vE=;\n\tb=SdZyXWEQxYZ9bf8rlVCTSw+k533PHWSpzPhKMiRy4p32Ffbc/CKZj1YgXOwU4TVY7+\n\trv3E03zLQmtl8HG60mXrEeYTN9S6qBlv1yB1EfIqYgk2vuXa40bUpAW0S466Q4/lSjoI\n\tfHvmP3mM5L+7f0gymwrHnvszD7/oQhSxl9ViBNYW39H9z8AGbc/YaVduzUveIZXnU2Hw\n\tSI80+HyiyGOPKI+tIcZ9N8gdd0/vBLJaNAS71ZPfHp3WX0xSkipok+zFSB4kiidpLxKd\n\tAVVc1hnTDxCPZt+5rji2Kw7l3R9ML90hYoXibQyn4hP71n8cjxuJd0k+deVbWOYGxUxx\n\tqXbQ==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"SdZyXWEQ\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1682514792; x=1685106792;\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=zoLEOeoTgZgHTXVqtppZR4khc2YZ0Sk1+YlJyvlS/vE=;\n\tb=SlXIZLo2uSQZatTxkh12hG36Skjxt8tj1Mo4v0zs+UCTqkFOCTslfid1Hm/c5s7NDW\n\tf6csl1QlIgV31AehJK/rzLU4UFg/Qp7zKbi9hnfvv/zLYTjz0pFxMcOP1fh296CY+SeS\n\tBJGAeiPrjRMrb6BtFAXfiRd/IYBJNvmCs9q1C86C6uQpql3qITeMERBUvHLjqAhCS+kx\n\t/A6EF+4nALsbZTy4J0SNdtsixV7WbWuZePCY41eo1blCieQaOejtn6U0KCypulEUWy8C\n\tHIzHAhXNn88GDbLFoOedKds5Y0cUy4JzobOvGhkrhRHZXTTYJTKEXV8ZBsGWr35I6zoM\n\tfLaQ==", "X-Gm-Message-State": "AC+VfDyI8Qx0RvcfYKL8/3VQ+3MLz7EalzlLtyOhN4+oQMqnRTGj3Iek\n\tWbwN2LQI5hoDxZqSpyNXqGdMxClhUmHk7alf/z7Reg==", "X-Google-Smtp-Source": "ACHHUZ4EeLACQa/Bu23AV9U5bi8RIVNBwmFqzuysn9VDe3XI2uWIiqt5tsRF/iuPs0fmuHeQGFb18A==", "X-Received": "by 2002:a05:600c:916:b0:3f1:7371:86bb with SMTP id\n\tm22-20020a05600c091600b003f1737186bbmr1603930wmp.20.1682514792647; \n\tWed, 26 Apr 2023 06:13:12 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 26 Apr 2023 14:10:46 +0100", "Message-Id": "<20230426131057.21550-3-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20230426131057.21550-1-naush@raspberrypi.com>", "References": "<20230426131057.21550-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 02/13] libcamera: ipa_proxy: Allow a\n\tprefix for the configuration file", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add a prefix parameter to IPAProxy::configurationFile(). This prefix is\nadded to the search path when locating IPA configuration files in the\nsystem directories.\n\nFor example, the system directories etc/libcamera/ipa/<prefix>/ and\nshare/libcamera/ipa/<prefix>/ will be used to search for the IPA\nconfiguration files.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n include/libcamera/internal/ipa_proxy.h | 3 ++-\n src/libcamera/ipa_proxy.cpp | 11 +++++++----\n src/libcamera/pipeline/ipu3/ipu3.cpp | 4 ++--\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 2 +-\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 ++--\n src/libcamera/pipeline/vimc/vimc.cpp | 2 +-\n test/ipa/ipa_interface_test.cpp | 2 +-\n 7 files changed, 16 insertions(+), 12 deletions(-)", "diff": "diff --git a/include/libcamera/internal/ipa_proxy.h b/include/libcamera/internal/ipa_proxy.h\nindex 781c8b623605..4ec357425fd3 100644\n--- a/include/libcamera/internal/ipa_proxy.h\n+++ b/include/libcamera/internal/ipa_proxy.h\n@@ -31,7 +31,8 @@ public:\n \n \tbool isValid() const { return valid_; }\n \n-\tstd::string configurationFile(const std::string &file) const;\n+\tstd::string configurationFile(const std::string &file,\n+\t\t\t\t const std::string &prefix) const;\n \n protected:\n \tstd::string resolvePath(const std::string &file) const;\ndiff --git a/src/libcamera/ipa_proxy.cpp b/src/libcamera/ipa_proxy.cpp\nindex 3f2cc6b89f60..4a27b0a993fa 100644\n--- a/src/libcamera/ipa_proxy.cpp\n+++ b/src/libcamera/ipa_proxy.cpp\n@@ -72,6 +72,7 @@ IPAProxy::~IPAProxy()\n /**\n * \\brief Retrieve the absolute path to an IPA configuration file\n * \\param[in] name The configuration file name\n+ * \\param[in] prefix The configuration directory prefix when searching system paths\n *\n * This function locates the configuration file for an IPA and returns its\n * absolute path. It searches the following directories, in order:\n@@ -80,8 +81,8 @@ IPAProxy::~IPAProxy()\n * environment variable ; or\n * - If libcamera is not installed, the src/ipa/ directory within the source\n * tree ; otherwise\n- * - The system sysconf (etc/libcamera/ipa) and the data (share/libcamera/ipa/)\n- * directories.\n+ * - The system sysconf (etc/libcamera/ipa/<prefix>/) and the data\n+ * (share/libcamera/ipa/<prefix>/) directories.\n *\n * The system directories are not searched if libcamera is not installed.\n *\n@@ -92,7 +93,8 @@ IPAProxy::~IPAProxy()\n * \\return The full path to the IPA configuration file, or an empty string if\n * no configuration file can be found\n */\n-std::string IPAProxy::configurationFile(const std::string &name) const\n+std::string IPAProxy::configurationFile(const std::string &name,\n+\t\t\t\t\tconst std::string &prefix) const\n {\n \tstruct stat statbuf;\n \tint ret;\n@@ -139,7 +141,8 @@ std::string IPAProxy::configurationFile(const std::string &name) const\n \t} else {\n \t\t/* Else look in the system locations. */\n \t\tfor (const auto &dir : utils::split(IPA_CONFIG_DIR, \":\")) {\n-\t\t\tstd::string confPath = dir + \"/\" + ipaName + \"/\" + name;\n+\t\t\tstd::string confPath = dir + \"/\" + prefix + \"/\" +\n+\t\t\t\t\t ipaName + \"/\" + name;\n \t\t\tret = stat(confPath.c_str(), &statbuf);\n \t\t\tif (ret == 0 && (statbuf.st_mode & S_IFMT) == S_IFREG)\n \t\t\t\treturn confPath;\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 355cb0cb76b8..a48d7e78d25e 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -1186,9 +1186,9 @@ int IPU3CameraData::loadIPA()\n \t * The API tuning file is made from the sensor name. If the tuning file\n \t * isn't found, fall back to the 'uncalibrated' file.\n \t */\n-\tstd::string ipaTuningFile = ipa_->configurationFile(sensor->model() + \".yaml\");\n+\tstd::string ipaTuningFile = ipa_->configurationFile(sensor->model() + \".yaml\", \"\");\n \tif (ipaTuningFile.empty())\n-\t\tipaTuningFile = ipa_->configurationFile(\"uncalibrated.yaml\");\n+\t\tipaTuningFile = ipa_->configurationFile(\"uncalibrated.yaml\", \"\");\n \n \tret = ipa_->init(IPASettings{ ipaTuningFile, sensor->model() },\n \t\t\t sensorInfo, sensor->controls(), &ipaControls_);\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 0060044143cc..a4fff28bf198 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1668,7 +1668,7 @@ int RPiCameraData::loadIPA(ipa::RPi::IPAInitResult *result)\n \t\tstd::string model = sensor_->model();\n \t\tif (isMonoSensor(sensor_))\n \t\t\tmodel += \"_mono\";\n-\t\tconfigurationFile = ipa_->configurationFile(model + \".json\");\n+\t\tconfigurationFile = ipa_->configurationFile(model + \".json\", \"\");\n \t} else {\n \t\tconfigurationFile = std::string(configFromEnv);\n \t}\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 8a30fe061d04..e338cdee2a2d 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -349,13 +349,13 @@ int RkISP1CameraData::loadIPA(unsigned int hwRevision)\n \tstd::string ipaTuningFile;\n \tchar const *configFromEnv = utils::secure_getenv(\"LIBCAMERA_RKISP1_TUNING_FILE\");\n \tif (!configFromEnv || *configFromEnv == '\\0') {\n-\t\tipaTuningFile = ipa_->configurationFile(sensor_->model() + \".yaml\");\n+\t\tipaTuningFile = ipa_->configurationFile(sensor_->model() + \".yaml\", \"\");\n \t\t/*\n \t\t * If the tuning file isn't found, fall back to the\n \t\t * 'uncalibrated' configuration file.\n \t\t */\n \t\tif (ipaTuningFile.empty())\n-\t\t\tipaTuningFile = ipa_->configurationFile(\"uncalibrated.yaml\");\n+\t\t\tipaTuningFile = ipa_->configurationFile(\"uncalibrated.yaml\", \"\");\n \t} else {\n \t\tipaTuningFile = std::string(configFromEnv);\n \t}\ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 204f5ad73f6d..5fbabcc5763d 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -472,7 +472,7 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n \n \tdata->ipa_->paramsBufferReady.connect(data.get(), &VimcCameraData::paramsBufferReady);\n \n-\tstd::string conf = data->ipa_->configurationFile(\"vimc.conf\");\n+\tstd::string conf = data->ipa_->configurationFile(\"vimc.conf\", \"\");\n \tFlags<ipa::vimc::TestFlag> inFlags = ipa::vimc::TestFlag::Flag2;\n \tFlags<ipa::vimc::TestFlag> outFlags;\n \tdata->ipa_->init(IPASettings{ conf, data->sensor_->model() },\ndiff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp\nindex 051ef96e7ed2..b25de222b9b4 100644\n--- a/test/ipa/ipa_interface_test.cpp\n+++ b/test/ipa/ipa_interface_test.cpp\n@@ -105,7 +105,7 @@ protected:\n \t\t}\n \n \t\t/* Test initialization of IPA module. */\n-\t\tstd::string conf = ipa_->configurationFile(\"vimc.conf\");\n+\t\tstd::string conf = ipa_->configurationFile(\"vimc.conf\", \"\");\n \t\tFlags<ipa::vimc::TestFlag> inFlags;\n \t\tFlags<ipa::vimc::TestFlag> outFlags;\n \t\tint ret = ipa_->init(IPASettings{ conf, \"vimc\" },\n", "prefixes": [ "libcamera-devel", "02/13" ] }