[{"id":35931,"web_url":"https://patchwork.libcamera.org/comment/35931/","msgid":"<20250919185735.GD8038@pendragon.ideasonboard.com>","date":"2025-09-19T18:57:35","subject":"Re: [PATCH v18 07/12] pipeline: simple: Allow enabling software ISP\n\tvia config file","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Fri, Sep 12, 2025 at 04:29:09PM +0200, Milan Zamazal wrote:\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\nThis should be\n\n        supported_devices:\n          - driver: DRIVER-NAME\n            software_isp: BOOLEAN\n          - ...\n\nI'll fix it.\n\n> \n> For example:\n> \n>   configuration:\n>     pipelines:\n>       simple:\n>         supported_devices:\n>         - driver: mxc-isi\n>           software_isp: true\n\nSame here.\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> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>\n\nI have a few ideas for improvement, but they can be implemented on top.\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@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>  \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)\n> +\t\t\t\t<< \"Configuration file overrides software ISP for \"\n> +\t\t\t\t<< info.driver << \" 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 D3191C328C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 19 Sep 2025 18:58:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 98A2E6B597;\n\tFri, 19 Sep 2025 20:58:09 +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 3E9EA62C35\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 19 Sep 2025 20:58:07 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 54759C67;\n\tFri, 19 Sep 2025 20:56:46 +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=\"fGVCLJJH\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1758308206;\n\tbh=d+q4N3vbp4g9S6Q+X18O54notxloMUwkIrFJTs1AYN4=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=fGVCLJJHYCqA1xCYwCia+9VVF7+NZHMXJk2lgu3nFU9mzg7dReMK45AJbMTNaPAnP\n\thMv/aBz7OODB6FBa2yZjH3XLD3QfKdL/Twq1wER7Lao9x/R/6mojPuTO0mBiULks/q\n\t25PQH/I38NPFPUjCwkQQsQr181wNpqxNRP4+teWw=","Date":"Fri, 19 Sep 2025 21:57:35 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org, Kieran Bingham\n\t<kieran.bingham@ideasonboard.com>, =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?=\n\t<barnabas.pocze@ideasonboard.com>, Paul Elder\n\t<paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v18 07/12] pipeline: simple: Allow enabling software ISP\n\tvia config file","Message-ID":"<20250919185735.GD8038@pendragon.ideasonboard.com>","References":"<20250912142915.53949-1-mzamazal@redhat.com>\n\t<20250912142915.53949-9-mzamazal@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20250912142915.53949-9-mzamazal@redhat.com>","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>"}}]