From patchwork Mon Jul 4 15:23:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Sylvestre X-Patchwork-Id: 16531 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 93CE5BD808 for ; Mon, 4 Jul 2022 15:23:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5437A6564E; Mon, 4 Jul 2022 17:23:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1656948206; bh=F0jri/bMLzBTIseBjTeOIjla4H+7zBN1XS4U9gcH06U=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=xnf4f7WylorvWEFQ6pd8tZr2CHgSRjX+sZ8KQQ83+71jXzPnksP8Lh1Hd/VfMpEAt kMm0iOPWI+jew1tH1Xa6zyk66L3eGJfDTaOCfDhzZxgxuQHRC9h5lVlra0j0dw9lHA XreVU3s9gKrUv8SNgDL+f5cFjhBQyvjOlFpDu4YkIc9vsi3tCQ7oA6wzGQ8JKh2ima 82HTuemzumlY+GcI5XnXs6BsTVc/BmGyhX6uCzCeoikAURpq/bnmlOXe4Wcq+wiGjd dF9Wl8ZNNiAvy5AXd1jnH+8sgOh2fhlARATxfMO44tE0nqiNCjQWRTsf1XhXahAfqE Q5GK2F3aGj0vA== Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 89A9B6564A for ; Mon, 4 Jul 2022 17:23:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20210112.gappssmtp.com header.i=@baylibre-com.20210112.gappssmtp.com header.b="U2RmQ8lX"; dkim-atps=neutral Received: by mail-wm1-x32e.google.com with SMTP id be14-20020a05600c1e8e00b003a04a458c54so5852456wmb.3 for ; Mon, 04 Jul 2022 08:23:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7dqw86XhV/+eZ0xQ2KZBrqn22bOd7txa8tBccccq8PI=; b=U2RmQ8lXIwsRpXVtZWnQftebYt6eW13mk0SVxWYMzRs/Q/I/JN/7fRMuU857EGADWC Ug786ZBUAQSFSONuuKv62jb2EOT3x45FZ8h2iKrmumUQjZ8CrmIPjbRCnTLA0lTQyV2Y 1kBQ1RaQB+zYELJXJ9y6kEY6nd89eu33ZforrZqN3Zq4Vwp0hFXTx6T13rW+D2Dwl1Gv Fpef+ooZjbt8kzcVTlG43lGjkX5Og6RUCNE60+UmiwgxoUakMr/lYFZjNt3hW/loKSam 49PZEUS4HWkB3zDP/RFyN06iqGld9VFD804GBoz27dpqErzv3pOTIxL2ykRzYoQ27MI7 z4sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7dqw86XhV/+eZ0xQ2KZBrqn22bOd7txa8tBccccq8PI=; b=D1wcsPdlUgf8D5GeC4cT/xkKxA4LBoS1UWsNbyOCQSSghM0KIxOrMmwrRuayDOiB9m r38hEkjvh+q3hN5iotVQxblFZqujEfXN/sWT0Qe/6DlIJO2aMSSuPkMLtoASkwuFivuH etfv4NHKSGw2T+GLpdatiFPQvuexTbjcnfpA2W5YBXpAApbws7ZMoOuEI5bfcYQJAd+o Sjw+l5whozxCVneI6cR1veK3lx9Cy+8/Z6S+EftOcWYAiOUyAev7UgGwNQGxgWa8JIUx tC1HbckKNuQ1BeNkUPs0BD02YuozlxjyPrBjxyjJsq5iDpd3gPkZs3B06u8Zd96I7icJ oCSg== X-Gm-Message-State: AJIora91h8ds24mMLXHJ9AbqNi9gNo3xN3/qDbtEpp8EHSgIihqf5NJl VH3CBycTBxQKVCidUFOtq91dcHJag39R7Q== X-Google-Smtp-Source: AGRyM1slce4K6GQYyYI/iKpSYFszHg5TY/JJdc/zMDYXcPtp4dFS3SoA8Ta9oybb28cAqv4awL6ceg== X-Received: by 2002:a7b:cb94:0:b0:3a2:af9a:e569 with SMTP id m20-20020a7bcb94000000b003a2af9ae569mr4232064wmi.144.1656948202886; Mon, 04 Jul 2022 08:23:22 -0700 (PDT) Received: from BL087.. ([2a01:e34:eea9:e630:ca4a:68b5:560f:5682]) by smtp.gmail.com with ESMTPSA id p15-20020a05600c204f00b0039c5cecf206sm19603199wmg.4.2022.07.04.08.23.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jul 2022 08:23:22 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Mon, 4 Jul 2022 17:23:15 +0200 Message-Id: <20220704152318.221213-2-fsylvestre@baylibre.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220704152318.221213-1-fsylvestre@baylibre.com> References: <20220704152318.221213-1-fsylvestre@baylibre.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/4] ipa: libipa: algorithm: Add queueRequest() to the Algorithm class 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: , X-Patchwork-Original-From: Florian Sylvestre via libcamera-devel From: Florian Sylvestre Reply-To: Florian Sylvestre Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Add queueRequest() function to the Algorithm class. The queueRequest() function provides controls values coming from the application to each algorithm. Each algorithm is responsible for retrieving the controls associated to them. Signed-off-by: Florian Sylvestre Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/ipa/ipu3/module.h | 2 +- src/ipa/libipa/algorithm.cpp | 13 +++++++++++++ src/ipa/libipa/algorithm.h | 6 ++++++ src/ipa/libipa/module.cpp | 5 +++++ src/ipa/libipa/module.h | 3 ++- src/ipa/rkisp1/module.h | 2 +- 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/src/ipa/ipu3/module.h b/src/ipa/ipu3/module.h index d94fc459..5c2179e0 100644 --- a/src/ipa/ipu3/module.h +++ b/src/ipa/ipu3/module.h @@ -20,7 +20,7 @@ namespace libcamera { namespace ipa::ipu3 { using Module = ipa::Module; + ipu3_uapi_params, ipu3_uapi_stats_3a, ControlList>; } /* namespace ipa::ipu3 */ diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp index 8549fe3f..1fb811ef 100644 --- a/src/ipa/libipa/algorithm.cpp +++ b/src/ipa/libipa/algorithm.cpp @@ -81,6 +81,19 @@ namespace ipa { * includes setting fields and flags that enable those processing blocks. */ +/** + * \fn Algorithm::queueRequest() + * \brief Provide control values to the algorithm + * \param[in] context The shared IPA context + * \param[in] frame The frame number to aplly the control values + * \param[in] controls The list of user controls + * + * This function provides controls values coming from the application to the + * algorithm. A frame number is provided to indicate the concerned frame. + * Each algorithm is responsible for retrieving the controls associated to + * them. + */ + /** * \fn Algorithm::process() * \brief Process ISP statistics, and run algorithm operations diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h index 2a8871d8..aa846625 100644 --- a/src/ipa/libipa/algorithm.h +++ b/src/ipa/libipa/algorithm.h @@ -40,6 +40,12 @@ public: { } + virtual void queueRequest([[maybe_unused]] typename Module::Context &context, + [[maybe_unused]] const uint32_t frame, + [[maybe_unused]] const typename Module::ControlList &controls) + { + } + virtual void process([[maybe_unused]] typename Module::Context &context, [[maybe_unused]] typename Module::FrameContext *frameContext, [[maybe_unused]] const typename Module::Stats *stats) diff --git a/src/ipa/libipa/module.cpp b/src/ipa/libipa/module.cpp index 77352104..e87a52fc 100644 --- a/src/ipa/libipa/module.cpp +++ b/src/ipa/libipa/module.cpp @@ -77,6 +77,11 @@ namespace ipa { * \brief The type of the IPA statistics and ISP results */ +/** + * \typedef Module::ControlList + * \brief The type of the ISP runtime controls list + */ + /** * \fn Module::algorithms() * \brief Retrieve the list of instantiated algorithms diff --git a/src/ipa/libipa/module.h b/src/ipa/libipa/module.h index 4149a353..81d3bf7f 100644 --- a/src/ipa/libipa/module.h +++ b/src/ipa/libipa/module.h @@ -26,7 +26,7 @@ LOG_DECLARE_CATEGORY(IPAModuleAlgo) namespace ipa { template + typename _Params, typename _Stats, typename _ControlList> class Module : public Loggable { public: @@ -35,6 +35,7 @@ public: using Config = _Config; using Params = _Params; using Stats = _Stats; + using ControlList = _ControlList; virtual ~Module() {} diff --git a/src/ipa/rkisp1/module.h b/src/ipa/rkisp1/module.h index 89f83208..08381a08 100644 --- a/src/ipa/rkisp1/module.h +++ b/src/ipa/rkisp1/module.h @@ -20,7 +20,7 @@ namespace libcamera { namespace ipa::rkisp1 { using Module = ipa::Module; + rkisp1_params_cfg, rkisp1_stat_buffer, ControlList>; } /* namespace ipa::rkisp1 */