From patchwork Sun Jun 28 23:19:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 8493 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 962D1C2E66 for ; Sun, 28 Jun 2020 23:19:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5EADD609DF; Mon, 29 Jun 2020 01:19:53 +0200 (CEST) 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="DTAfhe3L"; 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 D6C9F609E1 for ; Mon, 29 Jun 2020 01:19:44 +0200 (CEST) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 5EEBD556; Mon, 29 Jun 2020 01:19:44 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1593386384; bh=mNlD8aOt+X77E88Mf8ShXjO4b3i+Jz5ItIjT+S1qv0c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DTAfhe3LH7A40GgSWhszMiA2KX2VNO9G/qNBngReE+Wff7DGFq2vNJEWf5Q0ufo5B Hvjm+jsv0zFH/NpxJTJuJyYe0fR7Dw1wZvrhCDSp0BhkTqWBLeSnxrJD371kVLp/D8 wR2cJjNKrdtEMYLbZ/ivK59/cyt42XGu2TsDFm8E= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 29 Jun 2020 02:19:34 +0300 Message-Id: <20200628231934.29025-10-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200628231934.29025-1-laurent.pinchart@ideasonboard.com> References: <20200628231934.29025-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 9/9] libcamera: pipeline: raspberrypi: Don't handle any actions in stop state 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 RPI_IPA_ACTION_V4L2_SET_ISP is handled regardless of the pipeline handler state, but is only generated by the IPA when the pipeline is running. Don't handle it in the stopped state, which simplifies the handling of actions. Additionally, handleState() is a no-op when the state is State::Stopped, so don't call it in that case. Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund --- .../pipeline/raspberrypi/raspberrypi.cpp | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 137e07379cf5..2a5d27fefe0c 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -1190,24 +1190,12 @@ int RPiCameraData::configureIPA() void RPiCameraData::queueFrameAction(unsigned int frame, const IPAOperationData &action) { /* - * The following actions can be handled when the pipeline handler is in - * a stopped state. + * Actions are only handled when the pipeline handler is not in a + * stopped state. */ - switch (action.operation) { - case RPI_IPA_ACTION_V4L2_SET_ISP: { - ControlList controls = action.controls[0]; - isp_[Isp::Input].dev()->setControls(&controls); - goto done; - } - } - if (state_ == State::Stopped) - goto done; + return; - /* - * The following actions must not be handled when the pipeline handler - * is in a stopped state. - */ switch (action.operation) { case RPI_IPA_ACTION_V4L2_SET_STAGGERED: { const ControlList &controls = action.controls[0]; @@ -1216,6 +1204,12 @@ void RPiCameraData::queueFrameAction(unsigned int frame, const IPAOperationData break; } + case RPI_IPA_ACTION_V4L2_SET_ISP: { + ControlList controls = action.controls[0]; + isp_[Isp::Input].dev()->setControls(&controls); + break; + } + case RPI_IPA_ACTION_STATS_METADATA_COMPLETE: { unsigned int bufferId = action.data[0]; FrameBuffer *buffer = isp_[Isp::Stats].getBuffers()->at(bufferId).get(); @@ -1253,7 +1247,6 @@ void RPiCameraData::queueFrameAction(unsigned int frame, const IPAOperationData break; } -done: handleState(); }