[{"id":35173,"web_url":"https://patchwork.libcamera.org/comment/35173/","msgid":"<20250727215957.GB787@pendragon.ideasonboard.com>","date":"2025-07-27T21:59:57","subject":"Re: [PATCH v11 0/8] Enable raw streams with software ISP","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Jul 23, 2025 at 08:08:05PM +0200, Milan Zamazal wrote:\n> This makes raw streams working again in ‘simple’ pipeline when software\n> ISP is enabled for the given device.  At most one raw stream and one\n> processed stream (possibly both at once) are supported.\n> \n> An example ‘cam’ invocation requesting a raw stream rather than a debayered stream:\n> \n>   cam -c1 -C8 -s role=raw,width=1920,height=1080 -Ffile#.raw\n> \n> Or for both raw and processed streams:\n> \n>   cam -c1 -C8 -Ffile# \\\n>     -s role=viewfinder,width=1920,height=1080,pixelformat=RGB888 \\\n>     -s role=raw,width=3280,height=2464,pixelformat=SRGGB8\n> \n> When only a raw stream is requested, there are no exposure/gain\n> adjustments applied.  This could be improved in future, once software\n> ISP gets a mechanism to gather image statistics without processing and\n> using them to make the adjustments, or once manual exposure controls are\n> added to software ISP.  In the meantime, exposure must be changed\n> externally.\n\nIt's a pretty important feature, but let's go one step at a time. When\nimplementing support for this, I'd like to try and enable both manual\nand auto mode.\n\n> Changes in v11:\n> - Use rawStream_ pointer to a raw stream rather than rawRequested_ and\n>   processedRequested_ flags, as suggested by Umang.\n> - Selection of pipeline configurations reworked, partially incorporating\n>   Umang’s ideas and permitting adjustments of raw stream configurations\n>   if they don’t match the processed stream or what’s available from the\n>   sensor.\n> - Tested-by tags removed from here because the changes are substantial.\n>   v11 works better for me than both v10 and Umang’s RFC but it requires\n>   independent testing.\n> \n> Changes in v10:\n> - Missing initialisation of swIspEnabled_ added.\n> - \"Add plain output configurations\" patch dropped.  Raw configurations\n>   can be built implicitly from capture parameters.  Related adjustments\n>   in \"Validate raw stream configurations\".\n> - \"Identify requested stream roles\" patch dropped and merged into\n>   followup patches; camera configuration is updated in validate() and\n>   not in generateConfiguration() now.\n> - A commit title improved as suggested by Umang.\n> \n> Changes in v9:\n> - Fix of calling a wrong output buffer allocator when both raw and\n>   processed streams are used.\n> \n> Changes in v8:\n> - A missing `status = Adjusted' added to\n>   SimpleCameraConfiguration::validate.\n> - Code comments regarding raw colour space for raw requested roles\n>   added.\n> - Dropped raw format helpers.\n> \n> Changes in v7:\n> - Rebased on current master.\n> \n> Changes in v6:\n> - An unnecessary copy of formats avoided.\n> - rawRequested_ and processedrequested_ set to false when there are no\n>   roles.\n> - rawRequested_ and processedrequested_ updated in\n>   SimpleCameraConfiguration::validate().\n> \n> Changes in v5:\n> - Possible temporary segfault in the patch adding plain output\n>   configurations avoided.\n> - PixelFormatInfo::isRaw() helper added.\n> - SimplePipelineHandler::setUpFormatSizes replaced with a lambda\n>   function.\n> - SimpleCameraData::{rawRequested_,processedRequested_} are set in\n>   SimpleCameraConfiguration first and copied to SimpleCameraData only\n>   after successful configure().\n> \n> Changes in v4:\n> - Broken range pruning due to passing a value rather than a reference\n>   fixed.\n> - New common function isFormatRaw introduced.\n> - The patch assigning colour spaces in the simple pipeline, previously\n>   posted separately, included in this series, as the first patch.  It\n>   can still be handled separately; in any case the rest sort of depends\n>   on it.\n> - Setting metadataRequired to false where needed to prevent freezes and\n>   assertion errors; related to metadata reporting support merged to\n>   master since v3.\n> \n> Changes in v3:\n> - Significantly reworked, with both functional and clarity improvements.\n>   The level of guesswork and confusion is hopefully reduced enough now\n>   to drop the RFC prefix.\n> - The number of streams is set to 2 only with software ISP.\n> - SimpleCameraData::pipeConfig_ nullptr check patch dropped.\n> - PPM/raw file output patch dropped from this series.  Let’s handle this\n>   separately as the patch series is already complex enough.\n> \n> Changes in v2:\n> - Completely reworked.\n> - Extended to be able to produce a raw stream together with a processed\n>   stream.\n> \n> Milan Zamazal (8):\n>   libcamera: software_isp: Assign colour spaces in configurations\n>   libcamera: simple: Set the number of software ISP streams to 2\n>   libcamera: simple: Exclude raw configurations from output conversions\n>   libcamera: simple: Handle processed and raw formats separately\n>   libcamera: simple: Validate raw stream configurations\n>   libcamera: simple: Don't enforce conversion with an added raw stream\n>   libcamera: simple: Require metadata only when software ISP is used\n>   libcamera: simple: Make raw streams working\n> \n>  src/libcamera/pipeline/simple/simple.cpp | 283 ++++++++++++++++++-----\n>  1 file changed, 219 insertions(+), 64 deletions(-)","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 AF4F9C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 27 Jul 2025 22:00:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1BA8B69133;\n\tMon, 28 Jul 2025 00:00:10 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A640269080\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 28 Jul 2025 00:00:04 +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 7B77F55A;\n\tSun, 27 Jul 2025 23:59:22 +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=\"X8kMZKXL\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753653562;\n\tbh=0aMydfPeOB7Q8JT6Z61zkFkr5rGia7wU02QFFNbXGWg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=X8kMZKXLQGGPqS40CSwjcQR0iEKogfqvuyLc4b6ul0ZWICUhITOIc5mNBLrCe/wSd\n\tzMShZLcsck8RyaBgbII6tdfu9zzKRaNyTVE/E/53RuyAFK7PYoyaNZLeixsJs0Puv2\n\tAEo+c7/JTFNfAJ0N3YFvps5KhYa9fSYauqp43GjU=","Date":"Mon, 28 Jul 2025 00:59:57 +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>, Umang Jain <uajain@igalia.com>","Subject":"Re: [PATCH v11 0/8] Enable raw streams with software ISP","Message-ID":"<20250727215957.GB787@pendragon.ideasonboard.com>","References":"<20250723180815.82450-1-mzamazal@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20250723180815.82450-1-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>"}}]