[{"id":35736,"web_url":"https://patchwork.libcamera.org/comment/35736/","msgid":"<175740953665.2127323.5913536997176399060@neptunite.rasen.tech>","date":"2025-09-09T09:18:56","subject":"Re: [PATCH v16 07/12] config: Allow enabling software ISP in runtime","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Milan,\n\nThanks for the patch.\n\nQuoting Milan Zamazal (2025-07-29 16:31:55)\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\nOk, so you'd explicitly list the platforms that you want to use the simple\npipeline handler with.\n\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> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n\nThe commit title should s/config:/pipeline: simple/ since this touches simple\npipeline code and not global_configuration code.\n\nAlso maybe s/in runtime/via config file/ ?\n\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 4323472e1..70c41aed0 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> @@ -1679,6 +1681,17 @@ bool SimplePipelineHandler::matchDevice(MediaDevice *media,\n>         }\n>  \n>         swIspEnabled_ = info.swIspEnabled;\n> +       const GlobalConfiguration &configuration = cameraManager()->_d()->configuration();\n> +       for (GlobalConfiguration::Configuration entry :\n> +            configuration.configuration()[\"pipelines\"][\"simple\"][\"supported_devices\"]\n> +                    .asList()) {\n\nI was wondering why you didn't use option() but right YamlObject returns empty\nlists safetly. That's cool.\n\n> +               auto name = entry[\"driver\"].get<std::string>();\n> +               if (name == info.driver) {\n> +                       swIspEnabled_ = entry[\"software_isp\"].get<bool>().value_or(swIspEnabled_);\n> +                       LOG(SimplePipeline, Debug) << \"Overriding software ISP to \" << swIspEnabled_;\n\nI think it would be nice to also print the platform/driver as well as that the\noverride is coming from config file.\n\n\nOtherwise, looks good!\n\nThanks,\n\nPaul\n\n> +                       break;\n> +               }\n> +       }\n>  \n>         /* Locate the sensors. */\n>         std::vector<MediaEntity *> sensors = locateSensors(media);\n> -- \n> 2.50.1\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 94266BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Sep 2025 09:19:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3ECDD6936A;\n\tTue,  9 Sep 2025 11:19:05 +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 8CD4C69339\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Sep 2025 11:19:03 +0200 (CEST)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:6f3a:4f34:f1fa:8b3])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 87A20605;\n\tTue,  9 Sep 2025 11:17:49 +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=\"pyVDctza\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1757409470;\n\tbh=v2bEbn5HzvHSV1iuBb3JsFQagcXBXe5LFw1QXbYOQ8g=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=pyVDctzaQmMbVK34RboCeoR9G4qN0MwkQLlWvqtkATxK3rmE0j2OGGhvcReoH2pLb\n\tVV3+9KTiFMS0ddT5Hzsx3ev756o69CVpuEdXhmvu3Vv1sENfV17/JgthfYG22pOaEb\n\tKOd/ivWCeDfrri944MiC2YE6zf3sJfO9Hk78sjxA=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250729073201.5369-8-mzamazal@redhat.com>","References":"<20250729073201.5369-1-mzamazal@redhat.com>\n\t<20250729073201.5369-8-mzamazal@redhat.com>","Subject":"Re: [PATCH v16 07/12] config: Allow enabling software ISP in runtime","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Milan Zamazal <mzamazal@redhat.com>, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?=\n\t<barnabas.pocze@ideasonboard.com>, Laurent Pinchart\n\t<laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Tue, 09 Sep 2025 18:18:56 +0900","Message-ID":"<175740953665.2127323.5913536997176399060@neptunite.rasen.tech>","User-Agent":"alot/0.0.0","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":35743,"web_url":"https://patchwork.libcamera.org/comment/35743/","msgid":"<858qinrckq.fsf@mzamazal-thinkpadp1gen7.tpbc.csb>","date":"2025-09-09T13:16:05","subject":"Re: [PATCH v16 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 Paul,\n\nthank you for review.\n\nPaul Elder <paul.elder@ideasonboard.com> writes:\n\n> Hi Milan,\n>\n> Thanks for the patch.\n>\n> Quoting Milan Zamazal (2025-07-29 16:31:55)\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> Ok, so you'd explicitly list the platforms that you want to use the simple\n> pipeline handler with.\n\nOr not to use, the primary intended purpose is to allow overriding the\nhard-wired defaults.\n\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>> \n>> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n>\n> The commit title should s/config:/pipeline: simple/ since this touches simple\n> pipeline code and not global_configuration code.\n\nOK.\n\n> Also maybe s/in runtime/via config file/ ?\n\nOK.\n\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 4323472e1..70c41aed0 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>> @@ -1679,6 +1681,17 @@ bool SimplePipelineHandler::matchDevice(MediaDevice *media,\n>>         }\n>>  \n>>         swIspEnabled_ = info.swIspEnabled;\n>> +       const GlobalConfiguration &configuration = cameraManager()->_d()->configuration();\n>> +       for (GlobalConfiguration::Configuration entry :\n>> +            configuration.configuration()[\"pipelines\"][\"simple\"][\"supported_devices\"]\n>> +                    .asList()) {\n>\n> I was wondering why you didn't use option() but right YamlObject returns empty\n> lists safetly. That's cool.\n>\n>> +               auto name = entry[\"driver\"].get<std::string>();\n>> +               if (name == info.driver) {\n>> +                       swIspEnabled_ = entry[\"software_isp\"].get<bool>().value_or(swIspEnabled_);\n>> +                       LOG(SimplePipeline, Debug) << \"Overriding software ISP to \" << swIspEnabled_;\n>\n> I think it would be nice to also print the platform/driver as well as that the\n> override is coming from config file.\n\nGood idea, I'll add that.\n\n>\n> Otherwise, looks good!\n>\n> Thanks,\n>\n> Paul\n>\n>> +                       break;\n>> +               }\n>> +       }\n>>  \n>>         /* Locate the sensors. */\n>>         std::vector<MediaEntity *> sensors = locateSensors(media);\n>> -- \n>> 2.50.1\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 4A02CBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  9 Sep 2025 13:16:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CC0516936C;\n\tTue,  9 Sep 2025 15:16:15 +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 AF4A76934B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  9 Sep 2025 15:16:13 +0200 (CEST)","from mail-wm1-f71.google.com (mail-wm1-f71.google.com\n\t[209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-1-9UPaeZhsMFCF58WBxA7HHw-1; Tue, 09 Sep 2025 09:16:11 -0400","by mail-wm1-f71.google.com with SMTP id\n\t5b1f17b1804b1-45dd5c1b67dso30169625e9.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 09 Sep 2025 06:16:10 -0700 (PDT)","from mzamazal-thinkpadp1gen7.tpbc.csb ([85.93.96.130])\n\tby smtp.gmail.com with ESMTPSA id\n\tffacd0b85a97d-3e75223f448sm2599285f8f.50.2025.09.09.06.16.06\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 09 Sep 2025 06:16:08 -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=\"O5Y1oG9z\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1757423772;\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=idhcA56IB/R5IEx99Gj/t98MGa1kwN5WH5l0hx6Sceo=;\n\tb=O5Y1oG9zEaMIN1M0NvoxLtVMXmbx+cux+6Jbg1zTymW1raeIpJkTk6RI5byn5JhpVe5SVD\n\tkp5pjKkYrv1nMY2IaCbXvw3KRpvWi2hR/2TgKUqZVgDy33hKapF+tOm5QiOK8VfGw+7QFn\n\tsERwBPZLFg1Rw0iCgts3xz+iPTp/32s=","X-MC-Unique":"9UPaeZhsMFCF58WBxA7HHw-1","X-Mimecast-MFC-AGG-ID":"9UPaeZhsMFCF58WBxA7HHw_1757423770","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1757423770; x=1758028570;\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=idhcA56IB/R5IEx99Gj/t98MGa1kwN5WH5l0hx6Sceo=;\n\tb=RfVRpH1kWP5YOarFIgrWL0o45ZtgnnofT3RmLBAWjNDw2IjXO3Ajk4QwibKHk1nMxN\n\tFMPurpJ8/Jj7igv3llBGa//k4+14w3T7RLdPtEriRgxhpowbuG61HGDbVZVfDNSSVsSN\n\tUVN+W8Hvdn6aiqKLzwpjy91ood1xceveU8Emd2u3gZkH1hxTzHPz/mumsJzimH9s8Vaj\n\tWjeXMtHsP2c5lDXB5j/pcb3NfS6LxbCZbhv/uN+4n5DXABdoHJaDm5lVEmj0FoDiHLvC\n\tOOOhW8U5c28+R/sj4WCy/pwGGAuOgAWQPl9d7Av6qHaoP1MWMtQ/U9RxEo5eMwHzIblY\n\t9daw==","X-Gm-Message-State":"AOJu0YxSTJU9M5+PPFu3mzoYYAW+fv8wZpX8WAV+kb0/8vK/6BQr2zbI\n\t4cYcZUksW6hr7HApFA7oxz9u/nbr0LlryuiWnRISJurTolQ33/iv6+Him8PVjRenvSsEh/aNCwF\n\tJS4ZO+9Li1rzajyMcQ1/C7PgxDl9DbnGlmTzUwIk22GBSlbQ56sgEDhOnYpDUAb8lIcHLvPEI5f\n\tI=","X-Gm-Gg":"ASbGnctE0E/D5uJPTPGKGoDlk5MdCY2d5n0xhGhoAeyuVblHwsSeTwLjihckpTx6S/F\n\tyRX/+nrgKivaaUfhskEFngN1SG/GIti4ZJUV1UcYOC5RVVFeF+DKh2Oaps762HXh/6eIouft9cy\n\tt2HJCR14fpZFIPzhL1HCuHcYv2rceP3T5ptXFOgjtjYe8rXLyfj190ApdmGBahbC51KkT3q7c/v\n\tZ1D+/PybdilIedWvDiBAhU/2M3rfDswRZ2+IEkRafgQIJfXuvABx1r5JUuVqEdPXRb/fSRGlrco\n\twWdXp2tPCAH1NiJXs+Fu/QRCP5OR6Osa1UKpw7+RsuvsgONxOxBkmWvw42688CVW1g==","X-Received":["by 2002:a05:600c:1390:b0:458:c059:7db1 with SMTP id\n\t5b1f17b1804b1-45ddded6fd0mr128022775e9.30.1757423769660; \n\tTue, 09 Sep 2025 06:16:09 -0700 (PDT)","by 2002:a05:600c:1390:b0:458:c059:7db1 with SMTP id\n\t5b1f17b1804b1-45ddded6fd0mr128022345e9.30.1757423769105; \n\tTue, 09 Sep 2025 06:16:09 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IGLQDii52SzC1ZCIbSh/RzZ8wsy1G+j6QVYJ47mTYvT10N8ZlyCSIeD7NTbmyq+wdsa2XNTrg==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab?=\n\t=?utf-8?b?w6FzIFDFkWN6ZQ==?= <barnabas.pocze@ideasonboard.com>,\n\tLaurent Pinchart  <laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v16 07/12] config: Allow enabling software ISP in runtime","In-Reply-To":"<175740953665.2127323.5913536997176399060@neptunite.rasen.tech>\n\t(Paul Elder's message of \"Tue, 09 Sep 2025 18:18:56 +0900\")","References":"<20250729073201.5369-1-mzamazal@redhat.com>\n\t<20250729073201.5369-8-mzamazal@redhat.com>\n\t<175740953665.2127323.5913536997176399060@neptunite.rasen.tech>","Date":"Tue, 09 Sep 2025 15:16:05 +0200","Message-ID":"<858qinrckq.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":"CRJkx2HSqAG5OOCPaneU2VvVKcWzMN62sqFHDCvTs88_1757423770","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>"}}]