From patchwork Fri Mar 12 13:03:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jean-Michel Hautbois X-Patchwork-Id: 11570 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 AEEFDBD80E for ; Fri, 12 Mar 2021 13:03:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 608E768C6C; Fri, 12 Mar 2021 14:03:11 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="T8gIkgyV"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5852868C66 for ; Fri, 12 Mar 2021 14:03:09 +0100 (CET) Received: from localhost.localdomain (unknown [IPv6:2a01:e0a:169:7140:ddbd:a3a3:e47b:e390]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 054A7ACB; Fri, 12 Mar 2021 14:03:08 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1615554189; bh=S+sw8AnNzixDGFsi29crSAPwFg2agjZAZr/P/Xy5owI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=T8gIkgyVWf1O0ld/WDIFgcTay/oQFCbxa0SN0oiYWUCBwP8VBUOlvNL1JzQrCXRaj 9sFJ5ouDdcwgydIRixhILcPodppvsjaSkCWQaM2Kzjj2HDXLKSMlX3suEAEdglcpgV Szp3I/dwwx9FfIyVGXiO+7Zrn7TTjQIdQEuDQ0Gw= From: Jean-Michel Hautbois To: libcamera-devel@lists.libcamera.org Date: Fri, 12 Mar 2021 14:03:03 +0100 Message-Id: <20210312130304.34698-2-jeanmichel.hautbois@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210312130304.34698-1-jeanmichel.hautbois@ideasonboard.com> References: <20210312130304.34698-1-jeanmichel.hautbois@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/2] libcamera: ipu3: Move Imgu configuration to IPU3CameraData 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 IPU3 IPA needs to know the BayerDownScaler (BDS) configuration to calculate the statistics grids. This patch makes it possible for PipelineHandlerIPU3::start() to access the BDS configuration and later pass the rectangle to the IPU3 IPA configure method. Signed-off-by: Jean-Michel Hautbois --- src/libcamera/pipeline/ipu3/ipu3.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 00da2bb2..0d133031 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -70,6 +70,8 @@ public: CIO2Device cio2_; ImgUDevice *imgu_; + ImgUDevice::PipeConfig pipeConfig_; + Stream outStream_; Stream vfStream_; Stream rawStream_; @@ -97,7 +99,6 @@ public: Status validate() override; const StreamConfiguration &cio2Format() const { return cio2Configuration_; } - const ImgUDevice::PipeConfig imguConfig() const { return pipeConfig_; } /* Cache the combinedTransform_ that will be applied to the sensor */ Transform combinedTransform_; @@ -108,10 +109,9 @@ private: * corresponding Camera instance is valid. In order to borrow a * reference to the camera data, store a new reference to the camera. */ - const IPU3CameraData *data_; + IPU3CameraData *data_; StreamConfiguration cio2Configuration_; - ImgUDevice::PipeConfig pipeConfig_; }; class PipelineHandlerIPU3 : public PipelineHandler @@ -375,12 +375,13 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate() /* Only compute the ImgU configuration if a YUV stream has been requested. */ if (yuvCount) { - pipeConfig_ = data_->imgu_->calculatePipeConfig(&pipe); - if (pipeConfig_.isNull()) { + ImgUDevice::PipeConfig imguConfig = data_->imgu_->calculatePipeConfig(&pipe); + if (imguConfig.isNull()) { LOG(IPU3, Error) << "Failed to calculate pipe configuration: " << "unsupported resolutions."; return Invalid; } + data_->pipeConfig_ = imguConfig; } return status; @@ -576,7 +577,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) * stream has been requested: return here to skip the ImgU configuration * part. */ - ImgUDevice::PipeConfig imguConfig = config->imguConfig(); + ImgUDevice::PipeConfig imguConfig = data->pipeConfig_; if (imguConfig.isNull()) return 0;