From patchwork Wed Oct 2 16:19:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Klug X-Patchwork-Id: 21476 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 14A37BD80A for ; Wed, 2 Oct 2024 16:20:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id B5F756352B; Wed, 2 Oct 2024 18:20:29 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="A/jAcXU1"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7E49D63522 for ; Wed, 2 Oct 2024 18:20:28 +0200 (CEST) Received: from ideasonboard.com (unknown [IPv6:2a00:6020:448c:6c00:b246:b33f:c662:8ae1]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 958AF1961; Wed, 2 Oct 2024 18:18:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1727885935; bh=CssnFubvUamdyis/BcEWB10C/94940YtvnUa9bm7OMw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A/jAcXU1XNzznEJqrjEcX36oAlHAzXnByQMynpUdagu9mKkScGXfHkIbS2gVjSgni xextvyaXIVco2cQCHG4TAnCy1h99cccSj9lmxA9ikUidSr5XQ50kpyPigEkyD+qtnA 3kD6WtmCviO5YxLgpDx8pLGTmgb1585LlOqNM/rQ= From: Stefan Klug To: libcamera-devel@lists.libcamera.org Cc: Stefan Klug Subject: [PATCH v1 5/8] ipa: rkisp1: Add debug metadata support to the rkisp1 Date: Wed, 2 Oct 2024 18:19:23 +0200 Message-ID: <20241002161933.247091-6-stefan.klug@ideasonboard.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241002161933.247091-1-stefan.klug@ideasonboard.com> References: <20241002161933.247091-1-stefan.klug@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" Add a DebugMetadata helper to the context and add the corresponding plumbing. This is all that is needed to support debug metadata in an IPA. Signed-off-by: Stefan Klug --- src/ipa/rkisp1/ipa_context.h | 5 +++++ src/ipa/rkisp1/rkisp1.cpp | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/ipa/rkisp1/ipa_context.h b/src/ipa/rkisp1/ipa_context.h index d52e73ad2503..7b93a9e9461d 100644 --- a/src/ipa/rkisp1/ipa_context.h +++ b/src/ipa/rkisp1/ipa_context.h @@ -17,8 +17,11 @@ #include #include #include + #include +#include "libcamera/internal/debug_controls.h" + #include #include #include @@ -194,6 +197,8 @@ struct IPAContext { ControlInfoMap::Map ctrlMap; + DebugMetadata debugMetadata; + /* Interface to the Camera Helper */ std::unique_ptr camHelper; }; diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index a579f21de56f..5b1ef0c372c6 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -117,6 +117,7 @@ const IPAHwSettings ipaHwSettingsV12{ const ControlInfoMap::Map rkisp1Controls{ { &controls::AwbEnable, ControlInfo(false, true) }, { &controls::ColourGains, ControlInfo(0.0f, 3.996f, 1.0f) }, + { &controls::DebugMetadataEnable, ControlInfo(false, true, false) }, { &controls::Sharpness, ControlInfo(0.0f, 10.0f, 1.0f) }, { &controls::draft::NoiseReductionMode, ControlInfo(controls::draft::NoiseReductionModeValues) }, }; @@ -326,6 +327,7 @@ void IPARkISP1::unmapBuffers(const std::vector &ids) void IPARkISP1::queueRequest(const uint32_t frame, const ControlList &controls) { IPAFrameContext &frameContext = context_.frameContexts.alloc(frame); + context_.debugMetadata.checkForEnable(controls); for (auto const &a : algorithms()) { Algorithm *algo = static_cast(a.get()); @@ -368,6 +370,7 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId context_.camHelper->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get()); ControlList metadata(controls::controls); + context_.debugMetadata.assignControlList(&metadata); for (auto const &a : algorithms()) { Algorithm *algo = static_cast(a.get()); @@ -377,6 +380,7 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId } setControls(frame); + context_.debugMetadata.assignControlList(nullptr); metadataReady.emit(frame, metadata); }