[{"id":37282,"web_url":"https://patchwork.libcamera.org/comment/37282/","msgid":"<20251211021459.GD24488@pendragon.ideasonboard.com>","date":"2025-12-11T02:14:59","subject":"Re: [RFC PATCH 6/6] rkisp1: Add bypass configurations to ipa_context","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Tue, Dec 09, 2025 at 06:09:54PM +0000, Isaac Scott wrote:\n> The rkisp1 supports ISP bypass for RAW formats. There are other formats\n\nPlease list them.\n\n> that are not RAW which can also be used in this mode, which are not\n> currently supported by the rkisp1 pipeline handler.\n\nDon't patches 1 to 5 add support for those formats to the pipeline\nhandler ?\n\n> \n> Add a new IPA context member which tracks formats which are not RAW, so\n> we can attempt to use them in bypass mode if they are supported.\n> \n> Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>\n> ---\n>  src/ipa/rkisp1/ipa_context.h |  2 ++\n>  src/ipa/rkisp1/rkisp1.cpp    | 15 ++++++++++++++-\n>  2 files changed, 16 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> index b257cee55..28d25af18 100644\n> --- a/src/ipa/rkisp1/ipa_context.h\n> +++ b/src/ipa/rkisp1/ipa_context.h\n> @@ -70,7 +70,9 @@ struct IPASessionConfiguration {\n>  \t\tSize size;\n>  \t} sensor;\n>  \n> +\tbool bypass;\n>  \tbool raw;\n> +\n>  \tuint32_t paramFormat;\n>  };\n>  \n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index 9fee33de2..c195f0287 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -292,6 +292,19 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,\n>  \t\t\treturn format.colourEncoding == PixelFormatInfo::ColourEncodingRAW;\n>  \t\t});\n>  \n> +\t/*\n> +\t * Many formats are supported by the ISP in bypass mode, and are not RAW. Some support\n\nReflow to 80 columns.\n\n> +\t * both RAW and bypass, but for now we can keep track of those that are not RAW,\n> +\t * so we can attempt to use bypass for them.\n> +\t */\n> +\tcontext_.configuration.bypass = std::any_of(streamConfig.begin(), streamConfig.end(),\n> +\t\t[](auto &cfg) -> bool {\n> +\t\t\tPixelFormat pixelFormat{ cfg.second.pixelFormat };\n> +\t\t\tconst PixelFormatInfo &format = PixelFormatInfo::info(pixelFormat);\n> +\t\t\treturn format.colourEncoding != PixelFormatInfo::ColourEncodingRAW;\n> +\t\t});\n\nIf I understand this correctly, you're setting bypass to true if any of\nthe stream formats is not raw. That doesn't seem right. Have you tested\nthis series with a raw sensor and the ISP not bypassed ?\n\n> +\n> +\n\nExtra blank line.\n\n>  \tfor (auto const &a : algorithms()) {\n>  \t\tAlgorithm *algo = static_cast<Algorithm *>(a.get());\n>  \n> @@ -374,7 +387,7 @@ void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId,\n>  \t * provided.\n>  \t */\n>  \tconst rkisp1_stat_buffer *stats = nullptr;\n> -\tif (!context_.configuration.raw)\n> +\tif (!context_.configuration.bypass)\n>  \t\tstats = reinterpret_cast<rkisp1_stat_buffer *>(\n>  \t\t\tmappedBuffers_.at(bufferId).planes()[0].data());\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 C1F6EBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 11 Dec 2025 02:15:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A4CE261511;\n\tThu, 11 Dec 2025 03:15:21 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 12B88606D5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Dec 2025 03:15:20 +0100 (CET)","from pendragon.ideasonboard.com (fs96f9c361.tkyc007.ap.nuro.jp\n\t[150.249.195.97])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 176991988; \n\tThu, 11 Dec 2025 03:15:15 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"KQ8ZUF+3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1765419317;\n\tbh=b1oRLRlKy98mcJnAc77LpS/xi0+k3TaJ+idmjkYRCRc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=KQ8ZUF+3fTisx5Wb9dVQE7BsPmDK0ODUNgQuucUOpisDklZFo6zT7vaD7CyCDlY3C\n\tgIcpv2q33L6iwrpQ3vs1bFEvAhIVYKcZ9Eu1goZtqYTKxTg/ryTb6Z8jrEPUr41Kiy\n\tBxOZv94lzLL4d+TWoyHfIUxqBQyOr716QG6wTk9Y=","Date":"Thu, 11 Dec 2025 11:14:59 +0900","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Isaac Scott <isaac.scott@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [RFC PATCH 6/6] rkisp1: Add bypass configurations to ipa_context","Message-ID":"<20251211021459.GD24488@pendragon.ideasonboard.com>","References":"<20251209180954.332392-1-isaac.scott@ideasonboard.com>\n\t<20251209180954.332392-7-isaac.scott@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20251209180954.332392-7-isaac.scott@ideasonboard.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>"}},{"id":37299,"web_url":"https://patchwork.libcamera.org/comment/37299/","msgid":"<176545002533.76084.1664276134451715281@isaac-ThinkPad-T16-Gen-2>","date":"2025-12-11T10:47:05","subject":"Re: [RFC PATCH 6/6] rkisp1: Add bypass configurations to ipa_context","submitter":{"id":215,"url":"https://patchwork.libcamera.org/api/people/215/","name":"Isaac Scott","email":"isaac.scott@ideasonboard.com"},"content":"Hi Laurent,\n\nQuoting Laurent Pinchart (2025-12-11 02:14:59)\n> On Tue, Dec 09, 2025 at 06:09:54PM +0000, Isaac Scott wrote:\n> > The rkisp1 supports ISP bypass for RAW formats. There are other formats\n> \n> Please list them.\n> \n> > that are not RAW which can also be used in this mode, which are not\n> > currently supported by the rkisp1 pipeline handler.\n> \n> Don't patches 1 to 5 add support for those formats to the pipeline\n> handler ?\n> \n> > \n> > Add a new IPA context member which tracks formats which are not RAW, so\n> > we can attempt to use them in bypass mode if they are supported.\n> > \n> > Signed-off-by: Isaac Scott <isaac.scott@ideasonboard.com>\n> > ---\n> >  src/ipa/rkisp1/ipa_context.h |  2 ++\n> >  src/ipa/rkisp1/rkisp1.cpp    | 15 ++++++++++++++-\n> >  2 files changed, 16 insertions(+), 1 deletion(-)\n> > \n> > diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h\n> > index b257cee55..28d25af18 100644\n> > --- a/src/ipa/rkisp1/ipa_context.h\n> > +++ b/src/ipa/rkisp1/ipa_context.h\n> > @@ -70,7 +70,9 @@ struct IPASessionConfiguration {\n> >               Size size;\n> >       } sensor;\n> >  \n> > +     bool bypass;\n> >       bool raw;\n> > +\n> >       uint32_t paramFormat;\n> >  };\n> >  \n> > diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> > index 9fee33de2..c195f0287 100644\n> > --- a/src/ipa/rkisp1/rkisp1.cpp\n> > +++ b/src/ipa/rkisp1/rkisp1.cpp\n> > @@ -292,6 +292,19 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,\n> >                       return format.colourEncoding == PixelFormatInfo::ColourEncodingRAW;\n> >               });\n> >  \n> > +     /*\n> > +      * Many formats are supported by the ISP in bypass mode, and are not RAW. Some support\n> \n> Reflow to 80 columns.\n\nI'll fix that in the next series!\n\n> \n> > +      * both RAW and bypass, but for now we can keep track of those that are not RAW,\n> > +      * so we can attempt to use bypass for them.\n> > +      */\n> > +     context_.configuration.bypass = std::any_of(streamConfig.begin(), streamConfig.end(),\n> > +             [](auto &cfg) -> bool {\n> > +                     PixelFormat pixelFormat{ cfg.second.pixelFormat };\n> > +                     const PixelFormatInfo &format = PixelFormatInfo::info(pixelFormat);\n> > +                     return format.colourEncoding != PixelFormatInfo::ColourEncodingRAW;\n> > +             });\n> \n> If I understand this correctly, you're setting bypass to true if any of\n> the stream formats is not raw. That doesn't seem right. Have you tested\n> this series with a raw sensor and the ISP not bypassed ?\n> \n\nYou're absolutely right, I've been doing further work on this series and\nrealised that this is not the correct place to do this. This way breaks\nthe use case that already exists and makes it attempt to use bypass.\nI'll try to fix this issue in the next submission.\n\n> > +\n> > +\n> \n> Extra blank line.\n\nAck\n\n> \n> >       for (auto const &a : algorithms()) {\n> >               Algorithm *algo = static_cast<Algorithm *>(a.get());\n> >  \n> > @@ -374,7 +387,7 @@ void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId,\n> >        * provided.\n> >        */\n> >       const rkisp1_stat_buffer *stats = nullptr;\n> > -     if (!context_.configuration.raw)\n> > +     if (!context_.configuration.bypass)\n> >               stats = reinterpret_cast<rkisp1_stat_buffer *>(\n> >                       mappedBuffers_.at(bufferId).planes()[0].data());\n> >  \n\nThanks,\nIsaac\n\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 C2B2CBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 11 Dec 2025 10:47:10 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B8FA8615FF;\n\tThu, 11 Dec 2025 11:47:09 +0100 (CET)","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 51A1F610A6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 11 Dec 2025 11:47:08 +0100 (CET)","from thinkpad.ideasonboard.com\n\t(cpc90716-aztw32-2-0-cust408.18-1.cable.virginm.net [86.26.101.153])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 100C51661;\n\tThu, 11 Dec 2025 11:47:06 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"vMPpp8fe\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1765450026;\n\tbh=cQZfYLjk2d/9W1cLnB0Y7HiAhJwqL73SHm/Em+MyhXA=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=vMPpp8fek8ObFFYBCYQKQhgSLt6iuBTkUv3V7v+1iizEAdkpNd8SwxlYFs+Rv8zjm\n\tMbr/BRZw+yElxjf3qiAhqq8Vk0sB9Ft8u8OIUMfpMY0zhUXLFO8R44dmr4wtDB18fk\n\tfdM75ELSeGDNdDlrc3FV5gGxnkGhHoP5UK/tkhmM=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251211021459.GD24488@pendragon.ideasonboard.com>","References":"<20251209180954.332392-1-isaac.scott@ideasonboard.com>\n\t<20251209180954.332392-7-isaac.scott@ideasonboard.com>\n\t<20251211021459.GD24488@pendragon.ideasonboard.com>","Subject":"Re: [RFC PATCH 6/6] rkisp1: Add bypass configurations to ipa_context","From":"Isaac Scott <isaac.scott@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Thu, 11 Dec 2025 10:47:05 +0000","Message-ID":"<176545002533.76084.1664276134451715281@isaac-ThinkPad-T16-Gen-2>","User-Agent":"alot/0.10","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>"}}]