From patchwork Thu Aug 13 00:52:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 9301 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 6BEF5BD87E for ; Thu, 13 Aug 2020 00:53:48 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2E19C613C5; Thu, 13 Aug 2020 02:53:48 +0200 (CEST) Received: from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net [195.74.38.229]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 20F43613A2 for ; Thu, 13 Aug 2020 02:53:45 +0200 (CEST) X-Halon-ID: 6f8f9200-dcff-11ea-92dc-005056917a89 Authorized-sender: niklas.soderlund@fsdn.se Received: from bismarck.berto.se (p54ac52a8.dip0.t-ipconnect.de [84.172.82.168]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 6f8f9200-dcff-11ea-92dc-005056917a89; Thu, 13 Aug 2020 02:53:43 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Thu, 13 Aug 2020 02:52:44 +0200 Message-Id: <20200813005246.3265807-12-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200813005246.3265807-1-niklas.soderlund@ragnatech.se> References: <20200813005246.3265807-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 11/13] libcamera: pipeline: rkisp1: Track buffers for self path 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" In preparation of supporting both the main and self path extend RkISP1FrameInfo to track buffers from the self path stream. Signed-off-by: Niklas Söderlund --- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp index 671098e11a2e2750..3761b7ef7a9386e3 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp @@ -67,6 +67,7 @@ struct RkISP1FrameInfo { FrameBuffer *paramBuffer; FrameBuffer *statBuffer; FrameBuffer *mainPathBuffer; + FrameBuffer *selfPathBuffer; bool paramFilled; bool paramDequeued; @@ -270,7 +271,8 @@ RkISP1FrameInfo *RkISP1Frames::create(const RkISP1CameraData *data, Request *req FrameBuffer *statBuffer = pipe_->availableStatBuffers_.front(); FrameBuffer *mainPathBuffer = request->findBuffer(&data->mainPathStream_); - if (!mainPathBuffer) { + FrameBuffer *selfPathBuffer = request->findBuffer(&data->selfPathStream_); + if (!mainPathBuffer && !selfPathBuffer) { LOG(RkISP1, Error) << "Attempt to queue request with invalid stream"; return nullptr; @@ -285,6 +287,7 @@ RkISP1FrameInfo *RkISP1Frames::create(const RkISP1CameraData *data, Request *req info->request = request; info->paramBuffer = paramBuffer; info->mainPathBuffer = mainPathBuffer; + info->selfPathBuffer = selfPathBuffer; info->statBuffer = statBuffer; info->paramFilled = false; info->paramDequeued = false; @@ -343,7 +346,8 @@ RkISP1FrameInfo *RkISP1Frames::find(FrameBuffer *buffer) if (info->paramBuffer == buffer || info->statBuffer == buffer || - info->mainPathBuffer == buffer) + info->mainPathBuffer == buffer || + info->selfPathBuffer == buffer) return info; } @@ -415,7 +419,12 @@ protected: pipe_->param_->queueBuffer(info->paramBuffer); pipe_->stat_->queueBuffer(info->statBuffer); - pipe_->mainPathVideo_->queueBuffer(info->mainPathBuffer); + + if (info->mainPathBuffer) + pipe_->mainPathVideo_->queueBuffer(info->mainPathBuffer); + + if (info->selfPathBuffer) + pipe_->selfPathVideo_->queueBuffer(info->selfPathBuffer); } private: