From patchwork Fri Jun 3 13:22:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 16137 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 42D16BD160 for ; Fri, 3 Jun 2022 13:23:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 76BA365633; Fri, 3 Jun 2022 15:23:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1654262585; bh=euQiaSclFF+kv+068n4/2cyL2WydO2fiMk8CT33ZksM=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xphcew2WjQC75NAibBlag1kkgyFLiyvRk+JcqY0kT7pFPkbr+pGvUsmQ2QTw1ibo6 AkNUobBpmbZLnZ23gp+GeWDl/HZCZow8Dq6ZnGRNhv9RBSKMYqTuhtp+PrYomeFcLr Gv1oAGPbQN/tC/uf3IJ5iWAljN2uGDdi/1KpZsJedzBOQnBi1X2nfzWoFO9d2vRZdP B/slO+Zar2ZmzR4JT/fTx8ga9GEFhk+P36lsJx0/wb41qwI0zrIf6f0RF87SLnMsvC mfMe/GQJr3wf3wlSplco7BsHybHZWZu2O0W/ll4HOx5rRb2GPYa+DY4yulCdbwK6Y+ 5UxWCx+bnynkA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4D2D960105 for ; Fri, 3 Jun 2022 15:23:04 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="AHSXJ1dW"; dkim-atps=neutral Received: from perceval.ideasonboard.com (static-127-186-62-95.ipcom.comunitel.net [95.62.186.127]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 884BA10DD; Fri, 3 Jun 2022 15:23:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1654262583; bh=euQiaSclFF+kv+068n4/2cyL2WydO2fiMk8CT33ZksM=; h=From:To:Cc:Subject:Date:From; b=AHSXJ1dWg2Wy0QBql93BfB7SeO8KSiBnpss/WMflbdu1uyzR2raQlsWJvbYy+lcq1 Be0fIH30Otn10o6EvdrvHzu1VRQXhAN8MavwevFLFyuQorDoEJQgoQAtA/5Tevq3ey WHZADUGsCazNNwWCsQTGd1lv5NbPldFuKSjrFoqs= To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Jun 2022 15:22:55 +0200 Message-Id: <20220603132259.188845-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 0/4] Move frame contexts queue to separate 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: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Changes in v1 (from RFCv2): - Implement a proper mechanism to prevent FCQueue oveflow - Docs fixes - Minor &reference => *pointer conversions. Summary: This patch series moves the frame contexts ring buffer to a separate class. Minimialistic implementation in 1/4 to keep things run same. Patch 2/4 extends the .get() function to handle cases as : - Return same IPAFrameContext if previously created - Assign a new IPAFrameContext if the frame contexts for frame didn't exists - isFull() detection Patch 3/4 implements a mechanism to prevent overflowing the FCQueue Patch 4/4 removes IPAFrameContext pointer requirement from Algorithm::process() and use a frame number instead. Smoke tested briefly by running on nautilus. Umang Jain (4): ipa: ipu3: Separate out frame context queue as a distinct class ipa: ipu3: ipa_context: Extend FCQueue::get() ipa: ipu3: Prevent over queuing of requests ipa: algorithm: process() should take in frame number instead of context include/libcamera/ipa/ipu3.mojom | 2 +- src/ipa/ipu3/algorithms/af.cpp | 4 +- src/ipa/ipu3/algorithms/af.h | 2 +- src/ipa/ipu3/algorithms/agc.cpp | 13 ++- src/ipa/ipu3/algorithms/agc.h | 4 +- src/ipa/ipu3/algorithms/algorithm.h | 4 +- src/ipa/ipu3/algorithms/awb.cpp | 2 +- src/ipa/ipu3/algorithms/awb.h | 2 +- src/ipa/ipu3/algorithms/tone_mapping.cpp | 4 +- src/ipa/ipu3/algorithms/tone_mapping.h | 2 +- src/ipa/ipu3/ipa_context.cpp | 138 ++++++++++++++++++++++- src/ipa/ipu3/ipa_context.h | 20 +++- src/ipa/ipu3/ipu3.cpp | 33 ++++-- src/ipa/libipa/algorithm.cpp | 2 +- src/ipa/libipa/algorithm.h | 6 +- src/ipa/rkisp1/algorithms/agc.cpp | 3 +- src/ipa/rkisp1/algorithms/agc.h | 2 +- src/ipa/rkisp1/algorithms/algorithm.h | 5 +- src/ipa/rkisp1/algorithms/awb.cpp | 2 +- src/ipa/rkisp1/algorithms/awb.h | 2 +- src/ipa/rkisp1/rkisp1.cpp | 2 +- src/libcamera/pipeline/ipu3/ipu3.cpp | 10 +- 22 files changed, 216 insertions(+), 48 deletions(-)