[{"id":35026,"web_url":"https://patchwork.libcamera.org/comment/35026/","msgid":"<c90816a5-4bd7-4113-bf64-6e33279453dd@ideasonboard.com>","date":"2025-07-22T14:41:31","subject":"Re: [PATCH v14 07/12] config: Allow enabling software ISP in runtime","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 07. 15. 10:19 keltezéssel, Milan Zamazal írta:\n> This patch allows enabling or disabling software ISP in runtime in\n> addition to compile time.  This can be useful for software ISP testing\n> on various platforms as well as for overriding the defaults in case the\n> defaults don't work well (e.g. hardware ISP may or may not work on\n> i.MX8MP depending on the kernel and libcamera patches present in the\n> given system).\n> \n> The configuration is specified as follows:\n> \n>    configuration:\n>      pipelines:\n>        simple:\n>          supported_devices:\n>          - driver: DRIVER-NAME\n>            software_isp: BOOLEAN\n>          - ...\n> \n> For example:\n> \n>    configuration:\n>      pipelines:\n>        simple:\n>          supported_devices:\n>          - driver: mxc-isi\n>            software_isp: true\n> \n> The overall configuration of enabling or disabling software ISP may get\n> dropped in future but this patch is still useful in the meantime.\n\nDo you foresee that the configuration file will completely replace the\n`simple.cpp:supportedDevices` array at some point?\n\nRegards,\nBarnabás Pőcze\n\n\n> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n> ---\n>   src/libcamera/pipeline/simple/simple.cpp | 13 +++++++++++++\n>   1 file changed, 13 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index efb07051b..45d7a5c4a 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -30,11 +30,13 @@\n>   #include <libcamera/stream.h>\n>   \n>   #include \"libcamera/internal/camera.h\"\n> +#include \"libcamera/internal/camera_manager.h\"\n>   #include \"libcamera/internal/camera_sensor.h\"\n>   #include \"libcamera/internal/camera_sensor_properties.h\"\n>   #include \"libcamera/internal/converter.h\"\n>   #include \"libcamera/internal/delayed_controls.h\"\n>   #include \"libcamera/internal/device_enumerator.h\"\n> +#include \"libcamera/internal/global_configuration.h\"\n>   #include \"libcamera/internal/media_device.h\"\n>   #include \"libcamera/internal/pipeline_handler.h\"\n>   #include \"libcamera/internal/software_isp/software_isp.h\"\n> @@ -1688,6 +1690,17 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n>   \t}\n>   \n>   \tswIspEnabled_ = info->swIspEnabled;\n> +\tconst GlobalConfiguration &configuration = cameraManager()->_d()->configuration();\n> +\tfor (GlobalConfiguration::Configuration entry :\n> +\t     configuration.configuration()[\"pipelines\"][\"simple\"][\"supported_devices\"]\n> +\t\t     .asList()) {\n> +\t\tauto name = entry[\"driver\"].get<std::string>();\n> +\t\tif (name == info->driver) {\n> +\t\t\tswIspEnabled_ = entry[\"software_isp\"].get<bool>().value_or(swIspEnabled_);\n> +\t\t\tLOG(SimplePipeline, Debug) << \"Overriding software ISP to \" << swIspEnabled_;\n> +\t\t\tbreak;\n> +\t\t}\n> +\t}\n>   \n>   \t/* Locate the sensors. */\n>   \tstd::vector<MediaEntity *> sensors = locateSensors(media);","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 B3AD9BDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 22 Jul 2025 14:41:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 515C26903E;\n\tTue, 22 Jul 2025 16:41:34 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7D93968F93\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 22 Jul 2025 16:41:32 +0200 (CEST)","from [192.168.33.11] (185.221.140.39.nat.pool.zt.hu\n\t[185.221.140.39])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 858B379E6;\n\tTue, 22 Jul 2025 16:40:54 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"HZmLm398\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753195254;\n\tbh=gWN/vdK/NRLtIoOOwNRIuNf4Ix0uuLHeJzogVMzdxE4=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=HZmLm398EmOGzwL8LNGQZby+u37NoryibJlJN0TbfsoO0wiMRRorgQkQrRSAWrDyF\n\tkXbXL+g/oE2qXpLQUKVW6d6QzvYAqDhV1lOSyVBnei6mOpWHzPvk5HISFS4LPNAa6I\n\tjNoKFfWTrK1FEmqmUnwOutti7PHik5Ehj3iWLp0Y=","Message-ID":"<c90816a5-4bd7-4113-bf64-6e33279453dd@ideasonboard.com>","Date":"Tue, 22 Jul 2025 16:41:31 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v14 07/12] config: Allow enabling software ISP in runtime","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20250715081921.5522-1-mzamazal@redhat.com>\n\t<20250715081921.5522-8-mzamazal@redhat.com>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<20250715081921.5522-8-mzamazal@redhat.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","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":35089,"web_url":"https://patchwork.libcamera.org/comment/35089/","msgid":"<85h5z2lzno.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-07-24T09:13:31","subject":"Re: [PATCH v14 07/12] config: Allow enabling software ISP in runtime","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Hi Barnabás,\n\nBarnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:\n\n> Hi\n>\n> 2025. 07. 15. 10:19 keltezéssel, Milan Zamazal írta:\n>> This patch allows enabling or disabling software ISP in runtime in\n>> addition to compile time.  This can be useful for software ISP testing\n>> on various platforms as well as for overriding the defaults in case the\n>> defaults don't work well (e.g. hardware ISP may or may not work on\n>> i.MX8MP depending on the kernel and libcamera patches present in the\n>> given system).\n>> The configuration is specified as follows:\n>>    configuration:\n>>      pipelines:\n>>        simple:\n>>          supported_devices:\n>>          - driver: DRIVER-NAME\n>>            software_isp: BOOLEAN\n>>          - ...\n>> For example:\n>>    configuration:\n>>      pipelines:\n>>        simple:\n>>          supported_devices:\n>>          - driver: mxc-isi\n>>            software_isp: true\n>> The overall configuration of enabling or disabling software ISP may get\n>> dropped in future but this patch is still useful in the meantime.\n>\n> Do you foresee that the configuration file will completely replace the\n> `simple.cpp:supportedDevices` array at some point?\n\nI don't think so.  supportedDevices should define the standard defaults,\nwhile the configuration file setting serves to override it in special\ncases like testing/development or a broken driver etc.\n\n> Regards,\n> Barnabás Pőcze\n>\n>\n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>> ---\n>>   src/libcamera/pipeline/simple/simple.cpp | 13 +++++++++++++\n>>   1 file changed, 13 insertions(+)\n>> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n>> index efb07051b..45d7a5c4a 100644\n>> --- a/src/libcamera/pipeline/simple/simple.cpp\n>> +++ b/src/libcamera/pipeline/simple/simple.cpp\n>> @@ -30,11 +30,13 @@\n>>   #include <libcamera/stream.h>\n>>     #include \"libcamera/internal/camera.h\"\n>> +#include \"libcamera/internal/camera_manager.h\"\n>>   #include \"libcamera/internal/camera_sensor.h\"\n>>   #include \"libcamera/internal/camera_sensor_properties.h\"\n>>   #include \"libcamera/internal/converter.h\"\n>>   #include \"libcamera/internal/delayed_controls.h\"\n>>   #include \"libcamera/internal/device_enumerator.h\"\n>> +#include \"libcamera/internal/global_configuration.h\"\n>>   #include \"libcamera/internal/media_device.h\"\n>>   #include \"libcamera/internal/pipeline_handler.h\"\n>>   #include \"libcamera/internal/software_isp/software_isp.h\"\n>> @@ -1688,6 +1690,17 @@ bool SimplePipelineHandler::match(DeviceEnumerator *enumerator)\n>>   \t}\n>>     \tswIspEnabled_ = info->swIspEnabled;\n>> +\tconst GlobalConfiguration &configuration = cameraManager()->_d()->configuration();\n>> +\tfor (GlobalConfiguration::Configuration entry :\n>> +\t     configuration.configuration()[\"pipelines\"][\"simple\"][\"supported_devices\"]\n>> +\t\t     .asList()) {\n>> +\t\tauto name = entry[\"driver\"].get<std::string>();\n>> +\t\tif (name == info->driver) {\n>> +\t\t\tswIspEnabled_ = entry[\"software_isp\"].get<bool>().value_or(swIspEnabled_);\n>> +\t\t\tLOG(SimplePipeline, Debug) << \"Overriding software ISP to \" << swIspEnabled_;\n>> +\t\t\tbreak;\n>> +\t\t}\n>> +\t}\n>>     \t/* Locate the sensors. */\n>>   \tstd::vector<MediaEntity *> sensors = locateSensors(media);","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 26C37BDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Jul 2025 09:13:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 204AF690C4;\n\tThu, 24 Jul 2025 11:13:39 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5F111690BC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Jul 2025 11:13:37 +0200 (CEST)","from mail-ej1-f72.google.com (mail-ej1-f72.google.com\n\t[209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-436-8Z-GBpEIP8yIJyMAV1WDjg-1; Thu, 24 Jul 2025 05:13:34 -0400","by mail-ej1-f72.google.com with SMTP id\n\ta640c23a62f3a-ae354979e7aso67011066b.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Jul 2025 02:13:34 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb\n\t(ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\ta640c23a62f3a-af47f44d80dsm82962066b.90.2025.07.24.02.13.31\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 24 Jul 2025 02:13:32 -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=\"eGjoI+z/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1753348416;\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\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=0JF2f/eMqJXJ1GXtcEpmIoMhrLq8yiTHJzSAtLG5JoQ=;\n\tb=eGjoI+z/dV4D8aVO8D65Qtust3TRUEsY7sRijD++R6snJDmXE9RlDx64f0ukOyR8hmdTiF\n\tsSM4wYws24EnlvXVx3CtdL5gc0dTuYFdQNcG3A7kUnFkC0BtkJMMvIgffz2Lo1kcCcTfjb\n\tLurF7INuwRV/GwBCS9tBqOEstehEkAA=","X-MC-Unique":"8Z-GBpEIP8yIJyMAV1WDjg-1","X-Mimecast-MFC-AGG-ID":"8Z-GBpEIP8yIJyMAV1WDjg_1753348414","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1753348413; x=1753953213;\n\th=content-transfer-encoding:mime-version:user-agent:message-id:date\n\t:references:in-reply-to:subject:cc:to:from:x-gm-message-state:from\n\t:to:cc:subject:date:message-id:reply-to;\n\tbh=bTDaTK53LMmBLGKgn9E5VJ9UnSbVqdrj/i/+n+L2cQg=;\n\tb=S/JIb1m0ZFQ+GF3xgCCFTO0XCWjyUjBHpW/J8Gn05B8af7I/PuGlfFyn98delw9FW0\n\tWryVPCDE7O7H1PO+8oQAcIaN4w9RvFDh2brh7NuLmK9PCNVLWLKjNB+obM52xi0HHha1\n\tOatPiL3bLo425e+AVDSGXZ4XIrjd3u83Pzq9t/iQK2dDrRvH0eYsWPDJVliGGGZnT0ND\n\t3DVgmQgxgJhQ4gSB2KUIhVHKJFvNQOLHJpW9s38Mxq2HUWE3qJcaoy3yI3rshzS5KRJS\n\tQcqppHIBWmFQ0bgHLI3Eq2WuybfqEEt+BkxF6kWpyZO3aI0WFYb+onSWxZr8RBVIj9iK\n\tzKkw==","X-Gm-Message-State":"AOJu0YxBdYHrEJWyPC9RUpvYD2+CjbFIxTkdeW1XmcJtHuH1s/qt+xtf\n\tY65dstoI3JyNWsGO7Ma1RPk6ddl4JIKzkfYEvaeuOMiY1i/GmtY4+eB3tGsDr8wMwY21+utaR/k\n\tlY7fJDfZHUSP2BRuwO6gAo2nfwM/5nVDcm39fxUDi+W0FgYltAz0MfiFSvYT5dFdg6ZPr2KamZv\n\tdGRODUakU=","X-Gm-Gg":"ASbGnctOEnOPyYS9XKxKCAuZ26kYotkEFdGIDbYSQdhj7ftpjZMNTcaZoiSqy1pL1yk\n\tWEejyKJyeduGmikjv9NxIaTf8ZEOk4WaBRld64PpTeoGwreGTlSV7ypFAZls/KG8RveQn3fsF0i\n\tFrohWSEB5SIRdApDjdu4AOKWI5Jiv7MH23fb9nyxc/Hvzg/nEPEtv7JiM62GAYIW26u1/rdnceq\n\tcuMICkcMTSEfXT4LIzzqbvRpxK4pXa9ls/P6u6qieeKicEfX7dY3RRHfhUjMybA2JkBWYkS7dJ1\n\tb2yVBD5u2NHGh10gI3sxLGNGdyNucXyO/+BScfkz+PK+Pw3zVXnZd/U2G2Lr4LXqmKFfZVJ0b25\n\tim79cNrGxFX7aeQqT","X-Received":["by 2002:a17:907:3f8f:b0:ae3:163a:f69a with SMTP id\n\ta640c23a62f3a-af2f8857971mr624820266b.33.1753348413233; \n\tThu, 24 Jul 2025 02:13:33 -0700 (PDT)","by 2002:a17:907:3f8f:b0:ae3:163a:f69a with SMTP id\n\ta640c23a62f3a-af2f8857971mr624816166b.33.1753348412742; \n\tThu, 24 Jul 2025 02:13:32 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IFW0te55J4E68/cdCLMuJawWBcXyCTfrnM14oegF2ewAyc2+1WM1ykOO4Bq/RkJhrlb9VNrFw==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>,  Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v14 07/12] config: Allow enabling software ISP in runtime","In-Reply-To":"<c90816a5-4bd7-4113-bf64-6e33279453dd@ideasonboard.com> (\n\t=?utf-8?b?IkJhcm5hYsOhcyBQxZFjemUiJ3M=?= message of \"Tue,\n\t22 Jul 2025  16:41:31 +0200\")","References":"<20250715081921.5522-1-mzamazal@redhat.com>\n\t<20250715081921.5522-8-mzamazal@redhat.com>\n\t<c90816a5-4bd7-4113-bf64-6e33279453dd@ideasonboard.com>","Date":"Thu, 24 Jul 2025 11:13:31 +0200","Message-ID":"<85h5z2lzno.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"UX3_9obctvQYKmHlF4ojDaGPfaOVOSlCuRWuj3f4ZmY_1753348414","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"quoted-printable","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>"}}]