From patchwork Tue Dec 9 18:09:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Isaac Scott X-Patchwork-Id: 25395 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 943A6BD1F1 for ; Tue, 9 Dec 2025 18:10:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 45DDA61428; Tue, 9 Dec 2025 19:10:15 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="CoaKUhQI"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 34A9F61424 for ; Tue, 9 Dec 2025 19:10:09 +0100 (CET) Received: from isaac-ThinkPad-T16-Gen-2.infra.iob (cpc90716-aztw32-2-0-cust408.18-1.cable.virginm.net [86.26.101.153]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7A92663B; Tue, 9 Dec 2025 19:10:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1765303808; bh=9jyj2BrgKWbksGaynBXrrU6cv5b4GqT2L3evZK9s510=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CoaKUhQIg09QRUX6B33ku11eAxQniPeJq0DpMAL0z9U+pf9J/m+7R3ANI+/ncfi4Y 2zh3nlqRKcUdWbT+nmZB6IVORY62VedFkgBoWFtad6laXZckJbnpRVoznsnrfLjHLT gOGEQAqzggvT19dCYO+ANGk7sjfkokrlh8oW7o9c= From: Isaac Scott To: libcamera-devel@lists.libcamera.org Cc: Isaac Scott Subject: [RFC PATCH 6/6] rkisp1: Add bypass configurations to ipa_context Date: Tue, 9 Dec 2025 18:09:54 +0000 Message-ID: <20251209180954.332392-7-isaac.scott@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251209180954.332392-1-isaac.scott@ideasonboard.com> References: <20251209180954.332392-1-isaac.scott@ideasonboard.com> MIME-Version: 1.0 X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The rkisp1 supports ISP bypass for RAW formats. There are other formats that are not RAW which can also be used in this mode, which are not currently supported by the rkisp1 pipeline handler. Add a new IPA context member which tracks formats which are not RAW, so we can attempt to use them in bypass mode if they are supported. Signed-off-by: Isaac Scott --- src/ipa/rkisp1/ipa_context.h | 2 ++ src/ipa/rkisp1/rkisp1.cpp | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index b257cee55..28d25af18 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -70,7 +70,9 @@ struct IPASessionConfiguration { Size size; } sensor; + bool bypass; bool raw; + uint32_t paramFormat; }; diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 9fee33de2..c195f0287 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -292,6 +292,19 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig, return format.colourEncoding == PixelFormatInfo::ColourEncodingRAW; }); + /* + * Many formats are supported by the ISP in bypass mode, and are not RAW. Some support + * both RAW and bypass, but for now we can keep track of those that are not RAW, + * so we can attempt to use bypass for them. + */ + context_.configuration.bypass = std::any_of(streamConfig.begin(), streamConfig.end(), + [](auto &cfg) -> bool { + PixelFormat pixelFormat{ cfg.second.pixelFormat }; + const PixelFormatInfo &format = PixelFormatInfo::info(pixelFormat); + return format.colourEncoding != PixelFormatInfo::ColourEncodingRAW; + }); + + for (auto const &a : algorithms()) { Algorithm *algo = static_cast(a.get()); @@ -374,7 +387,7 @@ void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId, * provided. */ const rkisp1_stat_buffer *stats = nullptr; - if (!context_.configuration.raw) + if (!context_.configuration.bypass) stats = reinterpret_cast( mappedBuffers_.at(bufferId).planes()[0].data());