[{"id":29069,"web_url":"https://patchwork.libcamera.org/comment/29069/","msgid":"<CAEmqJPp2zAH4B3KDygd3Y0=HSMFhYSZAfFPrD83awD+p=vEVcw@mail.gmail.com>","date":"2024-03-26T12:15:24","subject":"Re: [RFC PATCH 07/11] config: Look up rpi config path in\n\tconfiguration file","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Milan,\n\nThank you for this patch.\n\nOn Tue, 26 Mar 2024 at 11:26, Milan Zamazal <mzamazal@redhat.com> wrote:\n>\n> The configuration snippet:\n>\n>   configuration:\n>     pipeline:\n>       rpi:\n>         config_file: FILENAME\n>\n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n\nI'm not sure if the pipeline specific config belongs in the global\nconfig file.  However, I am ok for this to be the case.  If it does,\nyou probably also want to do the same for the\n\"LIBCAMERA_RPI_TUNING_FILE\" config item in the same file.\n\nRegards,\nNaush\n\n\n>  src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 8 +++++++-\n>  1 file changed, 7 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> index 7e420b3f..8260a3ff 100644\n> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> @@ -20,6 +20,7 @@\n>  #include <libcamera/property_ids.h>\n>\n>  #include \"libcamera/internal/camera_lens.h\"\n> +#include \"libcamera/internal/global_configuration.h\"\n>  #include \"libcamera/internal/ipa_manager.h\"\n>  #include \"libcamera/internal/v4l2_subdevice.h\"\n>\n> @@ -1086,7 +1087,12 @@ int CameraData::loadPipelineConfiguration()\n>         /* Initial configuration of the platform, in case no config file is present */\n>         platformPipelineConfigure({});\n>\n> -       char const *configFromEnv = utils::secure_getenv(\"LIBCAMERA_RPI_CONFIG_FILE\");\n> +       std::optional<std::string> configFile =\n> +               GlobalConfiguration::envOption(\"LIBCAMERA_RPI_CONFIG_FILE\",\n> +                                              \"pipeline.rpi.config_file\");\n> +       if (!configFile.has_value())\n> +               return 0;\n> +       char const *configFromEnv = configFile.value().c_str();\n>         if (!configFromEnv || *configFromEnv == '\\0')\n>                 return 0;\n>\n> --\n> 2.42.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 C3BD9C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 26 Mar 2024 12:16:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 06A5A63311;\n\tTue, 26 Mar 2024 13:16:04 +0100 (CET)","from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com\n\t[IPv6:2607:f8b0:4864:20::112c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 620ED63037\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Mar 2024 13:16:01 +0100 (CET)","by mail-yw1-x112c.google.com with SMTP id\n\t00721157ae682-60a046c5262so51429827b3.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 26 Mar 2024 05:16:01 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"oQ2gLAOT\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1711455360; x=1712060160;\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=XRec2ylNtBGHr6D5KCvRlSSEifWz6YirLwG/wSJu4is=;\n\tb=oQ2gLAOTgbWHZLsTOZ/1JgGGnFKuRt9Eyipdb+69j1YzwNbs3EVDEXap06Xp3qzkv4\n\tbVuApL2I1DgeGCccwGEqOsQOANwrJE7wFsubzG4Vbsm9a2UQXjlkMrOv92SOlmco81ag\n\tekHXzXeBK1cRGcNgskBgrdYjZnlR1sXhsKHuvSfA3HNG9vg9zgWCeJLTOMgVU12fBDE7\n\tReaFDfd+A71NH4jDxY4s5SIsQYvH+aCrzHAP8PeU1IYq+NIdf0t62GL3pbHKjc+ZbUUx\n\t/jlTj9mukfjDWB4ab0/aTGEP/q092lGQKMje7FOnWq+N/OYRGUXjdFgezR5+KktvV3B0\n\tQokg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1711455360; x=1712060160;\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=XRec2ylNtBGHr6D5KCvRlSSEifWz6YirLwG/wSJu4is=;\n\tb=WFrZjmicududEHc8ZPm8Qy+bbGDxo7JNrLdizNrA71MtS7DqkWTgaWkdUik03xnCcu\n\t3bVlF1AZJN82ct0J7V7VmqPcwMVxAthbHgz0uhM7WJud3JcVOWwr6RzhkCo18gNspacF\n\tpd42XN3Q7d2XrfDgE9BsZwrSK5uEnbhas43XtVFPLcVZGBaBeE09/Wgag7ZdVlkqfQ5A\n\tDpir/pNWfeEP8Ejjz4RJhhx8zQI6dcAT0Aco0HVr1h8NvSbNK9eZN0Bc9Xtu7d6M04he\n\tVJ/UPFhgLDZ0ABwx0O4ZHslnblZHYCiPpJbEZinSKiCfmyQ2CzY6f1j57uou+rr6LIxe\n\tZ6dA==","X-Gm-Message-State":"AOJu0Yx8THCtR1mMUZXdJGG4B08pLYeProUZetndqCicJzA9P9FoK6bh\n\tnnYJwyd4BIvX4NwHIMAFEqejEIozWSCRmHIMJvSYtXzOPa1UzDo2fUuDRG0to/K7nsM35MmbkpY\n\tDzmqBKMm/mxHemArqUie/8xGSzTPJZ+6lxnnL5A==","X-Google-Smtp-Source":"AGHT+IHih47Y++mWy/bg8x2Yf3hWKgYyIREc61bClekV2fdGUPhBm1JkYvSufHVJykC7PY1HtXZAMdh7eG99BcX44lY=","X-Received":"by 2002:a0d:d045:0:b0:609:8ed6:c491 with SMTP id\n\ts66-20020a0dd045000000b006098ed6c491mr8908054ywd.26.1711455360174;\n\tTue, 26 Mar 2024 05:16:00 -0700 (PDT)","MIME-Version":"1.0","References":"<20240326112419.503286-1-mzamazal@redhat.com>\n\t<20240326112419.503286-8-mzamazal@redhat.com>","In-Reply-To":"<20240326112419.503286-8-mzamazal@redhat.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Tue, 26 Mar 2024 12:15:24 +0000","Message-ID":"<CAEmqJPp2zAH4B3KDygd3Y0=HSMFhYSZAfFPrD83awD+p=vEVcw@mail.gmail.com>","Subject":"Re: [RFC PATCH 07/11] config: Look up rpi config path in\n\tconfiguration file","To":"Milan Zamazal <mzamazal@redhat.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":29152,"web_url":"https://patchwork.libcamera.org/comment/29152/","msgid":"<87h6gh2si5.fsf@redhat.com>","date":"2024-04-04T12:59:30","subject":"Re: [RFC PATCH 07/11] config: Look up rpi config path in\n\tconfiguration file","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Naush,\n\nthank you for your comment.\n\nNaushir Patuck <naush@raspberrypi.com> writes:\n\n> Hi Milan,\n>\n> Thank you for this patch.\n>\n> On Tue, 26 Mar 2024 at 11:26, Milan Zamazal <mzamazal@redhat.com> wrote:\n>>\n>> The configuration snippet:\n>>\n>>   configuration:\n>>     pipeline:\n>>       rpi:\n>>         config_file: FILENAME\n>>\n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>\n> I'm not sure if the pipeline specific config belongs in the global\n> config file.  However, I am ok for this to be the case.\n\nI'd say if it is configurable via environment variable then it belongs to the\nglobal config file.  But I don't have a strong opinion about it.\n\n> If it does, you probably also want to do the same for the\n> \"LIBCAMERA_RPI_TUNING_FILE\" config item in the same file.\n\nAh, right, will add it in v2.\n\nThanks,\nMilan\n\n> Regards,\n> Naush\n>\n>\n>>  src/libcamera/pipeline/rpi/common/pipeline_base.cpp | 8 +++++++-\n>>  1 file changed, 7 insertions(+), 1 deletion(-)\n>>\n>> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n>> index 7e420b3f..8260a3ff 100644\n>> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n>> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n>> @@ -20,6 +20,7 @@\n>>  #include <libcamera/property_ids.h>\n>>\n>>  #include \"libcamera/internal/camera_lens.h\"\n>> +#include \"libcamera/internal/global_configuration.h\"\n>>  #include \"libcamera/internal/ipa_manager.h\"\n>>  #include \"libcamera/internal/v4l2_subdevice.h\"\n>>\n>> @@ -1086,7 +1087,12 @@ int CameraData::loadPipelineConfiguration()\n>>         /* Initial configuration of the platform, in case no config file is present */\n>>         platformPipelineConfigure({});\n>>\n>> -       char const *configFromEnv = utils::secure_getenv(\"LIBCAMERA_RPI_CONFIG_FILE\");\n>> +       std::optional<std::string> configFile =\n>> +               GlobalConfiguration::envOption(\"LIBCAMERA_RPI_CONFIG_FILE\",\n>> +                                              \"pipeline.rpi.config_file\");\n>> +       if (!configFile.has_value())\n>> +               return 0;\n>> +       char const *configFromEnv = configFile.value().c_str();\n>>         if (!configFromEnv || *configFromEnv == '\\0')\n>>                 return 0;\n>>\n>> --\n>> 2.42.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 BD262BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Apr 2024 12:59:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AC83C63381;\n\tThu,  4 Apr 2024 14:59:37 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.129.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A8B2C63379\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Apr 2024 14:59:36 +0200 (CEST)","from mail-wr1-f71.google.com (mail-wr1-f71.google.com\n\t[209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-133-ZcTpLQeNMt6dILpgtME4TQ-1; Thu, 04 Apr 2024 08:59:34 -0400","by mail-wr1-f71.google.com with SMTP id\n\tffacd0b85a97d-343c6a990dbso258119f8f.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 04 Apr 2024 05:59:33 -0700 (PDT)","from nuthatch (nat-pool-brq-t.redhat.com. [213.175.37.10])\n\tby smtp.gmail.com with ESMTPSA id\n\teh9-20020a056000410900b0033b48190e5esm7797349wrb.67.2024.04.04.05.59.30\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 04 Apr 2024 05:59:30 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"grpzr+tJ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1712235575;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=5jUjMWmr1qeyrPXrBsZtuAr8kdihhSjIMvjCxFsLFXM=;\n\tb=grpzr+tJCxuEvE+V/Ob+BLJsDUGa3RsjTsx2FLYNqhN/wcFzvcpk8yKOrsIbE7/KuAvAyW\n\tk7y+z75exHzO3Rvi0c3t8IXvZejWbchPaUolLy2TaOIClmt9Q7ZO9nPTj/6kMYZJImmsvq\n\t2sagDdHhDSgGNyoPiuC4yyiIz2roTRc=","X-MC-Unique":"ZcTpLQeNMt6dILpgtME4TQ-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1712235572; x=1712840372;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=5jUjMWmr1qeyrPXrBsZtuAr8kdihhSjIMvjCxFsLFXM=;\n\tb=oqVHOqbaqOmW+A7l0nQAWkX/f0dU1nfu+CPO8cbGY7+2c8EWoyPHwI+1TV0mrq/3lc\n\tne0E4vF2SiAsSmQLJV1IaVe14/KIxn+yr3iRgqKtoXKhpH4l0gaP+GaI0ZVJlXcJFDo2\n\tltw1r79veeXyPe3/CmRKHkl+Srg7YCx9a6yg/iHvi/g9jtToqxjC0sj9mmMnvfzT8pKh\n\tws21K0bBUflQy/WbjKZupGE9GxbXrtVIkOxZnSbczuD8NUjfi4AvWcc6ox5FAiIKasaV\n\tfZ+ghgVF1mQrfX8hq4dPd62/iS7zXBXtKNC3spGZoEaXH0iBSpwGaYmZwYp29OPe5WVa\n\t5R6g==","X-Gm-Message-State":"AOJu0YwKVPRXZYvwpzKD88+NgVjsFD2ViDzIfWjIADKmE1rQtl6YkcsL\n\tupT/gejEeOHuPcZ+zyshS3mmG6Fh9YtP/8RVdyNNzQTMH8/uYTiNwTWurzVyWMB5XoZKl3w7ymV\n\tnQxaW2wAtLzDNlotbiJD/CDyuviAUwOmnMw7fmnrNe9Aj7LZr4lS3/Yfj9dyErm/wOjha4wMjC8\n\tea/B62XD79R4DsT7nGC1ZZXaicz4GfYzr6ixEY9tnME6IAIleMkOzh1zA=","X-Received":["by 2002:adf:e787:0:b0:343:70cd:48e6 with SMTP id\n\tn7-20020adfe787000000b0034370cd48e6mr5413973wrm.33.1712235572196; \n\tThu, 04 Apr 2024 05:59:32 -0700 (PDT)","by 2002:adf:e787:0:b0:343:70cd:48e6 with SMTP id\n\tn7-20020adfe787000000b0034370cd48e6mr5413950wrm.33.1712235571692; \n\tThu, 04 Apr 2024 05:59:31 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IHJiDnAaRSSOZw09h/t2vgdyTeW9UAzJou/gWV2A+gds3IM3nHi3+Od1UE9epcr3D7oYQ3kUA==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH 07/11] config: Look up rpi config path in\n\tconfiguration file","In-Reply-To":"<CAEmqJPp2zAH4B3KDygd3Y0=HSMFhYSZAfFPrD83awD+p=vEVcw@mail.gmail.com>\n\t(Naushir Patuck's message of \"Tue, 26 Mar 2024 12:15:24 +0000\")","References":"<20240326112419.503286-1-mzamazal@redhat.com>\n\t<20240326112419.503286-8-mzamazal@redhat.com>\n\t<CAEmqJPp2zAH4B3KDygd3Y0=HSMFhYSZAfFPrD83awD+p=vEVcw@mail.gmail.com>","Date":"Thu, 04 Apr 2024 14:59:30 +0200","Message-ID":"<87h6gh2si5.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}}]