From patchwork Sat Jun 27 03:00:40 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: 8452 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 E735FC2E67 for ; Sat, 27 Jun 2020 03:01:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A552260B05; Sat, 27 Jun 2020 05:01:00 +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 43F8A609E1 for ; Sat, 27 Jun 2020 05:00:57 +0200 (CEST) X-Halon-ID: 583ef079-b822-11ea-86ee-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2eca.dip0.t-ipconnect.de [79.202.46.202]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 583ef079-b822-11ea-86ee-0050569116f7; Sat, 27 Jun 2020 05:00:23 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Sat, 27 Jun 2020 05:00:40 +0200 Message-Id: <20200627030043.2088585-11-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200627030043.2088585-1-niklas.soderlund@ragnatech.se> References: <20200627030043.2088585-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 10/13] libcamera: ipu3: Remove the active flag from IPU3Stream 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 active_ flag is only used inside one function, remove the global flag and handle it inside the single function. Signed-off-by: Niklas Söderlund --- src/libcamera/pipeline/ipu3/ipu3.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 1f320dc166767bab..b72b631cdc051aab 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -33,13 +33,6 @@ LOG_DEFINE_CATEGORY(IPU3) class IPU3Stream : public Stream { -public: - IPU3Stream() - : active_(false) - { - } - - bool active_; }; class IPU3CameraData : public CameraData @@ -486,8 +479,8 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) return ret; /* Apply the format to the configured streams output devices. */ - outStream->active_ = false; - vfStream->active_ = false; + bool outActive = false; + bool vfActive = false; for (unsigned int i = 0; i < config->size(); ++i) { /* @@ -499,7 +492,6 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) IPU3Stream *stream = const_cast(config->streams()[i]); StreamConfiguration &cfg = (*config)[i]; - stream->active_ = true; cfg.setStream(stream); if (stream == outStream) { @@ -508,12 +500,14 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) return ret; cfg.stride = outputFormat.planes[0].bpl; + outActive = true; } else if (stream == vfStream) { ret = imgu->configureViewfinder(cfg, &outputFormat); if (ret) return ret; cfg.stride = outputFormat.planes[0].bpl; + vfActive = true; } else { /* * The RAW still capture stream just copies buffers from @@ -529,13 +523,13 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) * the configuration of the active one for that purpose (there should * be at least one active stream in the configuration request). */ - if (!outStream->active_) { + if (!outActive) { ret = imgu->configureOutput(config->at(0), &outputFormat); if (ret) return ret; } - if (!vfStream->active_) { + if (!vfActive) { ret = imgu->configureViewfinder(config->at(0), &outputFormat); if (ret) return ret; @@ -555,7 +549,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c) /* Apply the "pipe_mode" control to the ImgU subdevice. */ ControlList ctrls(imgu->imgu_->controls()); ctrls.set(V4L2_CID_IPU3_PIPE_MODE, - static_cast(vfStream->active_ ? IPU3PipeModeVideo : + static_cast(vfActive ? IPU3PipeModeVideo : IPU3PipeModeStillCapture)); ret = imgu->imgu_->setControls(&ctrls); if (ret) {