[libcamera-devel] [PATCH v1 9/9] libcamera: pipeline: raspberrypi: Don't handle any actions in stop state
Niklas Söderlund
niklas.soderlund at ragnatech.se
Mon Jun 29 16:56:38 CEST 2020
Hi Laurent,
Thanks for your work.
On 2020-06-29 02:19:34 +0300, Laurent Pinchart wrote:
> 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 <laurent.pinchart at ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
> ---
> .../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();
> }
>
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
--
Regards,
Niklas Söderlund
More information about the libcamera-devel
mailing list