[{"id":35793,"web_url":"https://patchwork.libcamera.org/comment/35793/","msgid":"<175766737138.2127323.13638570462698556257@neptunite.rasen.tech>","date":"2025-09-12T08:56:11","subject":"Re: [PATCH v17 07/12] pipeline: simple: Allow enabling software ISP\n\tvia config file","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Hi Milan,\n\nQuoting Milan Zamazal (2025-09-11 18:29:37)\n> This patch allows enabling or disabling software ISP via config file 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> \n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n\nLooks good to me.\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 15 +++++++++++++++\n>  1 file changed, 15 insertions(+)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index 4f914be80..c816cffc9 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> @@ -1682,6 +1684,19 @@ 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> +               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)\n> +                               << \"Configuration file overrides software ISP for \"\n> +                               << info.driver << \" to \" << swIspEnabled_;\n> +                       break;\n> +               }\n> +       }\n>  \n>         /* Locate the sensors. */\n>         std::vector<MediaEntity *> sensors = locateSensors(media);\n> -- \n> 2.51.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 58664C324E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 12 Sep 2025 08:56:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 02D0969370;\n\tFri, 12 Sep 2025 10:56:19 +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 D6523613A3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 12 Sep 2025 10:56:17 +0200 (CEST)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:5c83:71e0:e0c7:1670])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 2FE1514A6; \n\tFri, 12 Sep 2025 10:55:01 +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=\"KEEyyMCG\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1757667302;\n\tbh=VdEn+sF2c40lFHgEHX5yS9RsvA18k2Bk6vlSF+yp+JM=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=KEEyyMCGGfGCHl5F2Q9XRvdatMD+0ItF6muK7OO2ySspZxp9ptk27shQma6C1kh4Y\n\t6bNlybNgurYz/powFZIkb2SjZk6fgJzCbds2JR8OURese2fiR8ArsD9sjQx9UqsdM5\n\tZRFCYZmGLOuVWmC0TD9ctvzPEA6ntUUhf9xr4DRU=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250911092945.16517-8-mzamazal@redhat.com>","References":"<20250911092945.16517-1-mzamazal@redhat.com>\n\t<20250911092945.16517-8-mzamazal@redhat.com>","Subject":"Re: [PATCH v17 07/12] pipeline: simple: Allow enabling software ISP\n\tvia config file","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":"Fri, 12 Sep 2025 17:56:11 +0900","Message-ID":"<175766737138.2127323.13638570462698556257@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>"}}]