[libcamera-devel,v2,02/11] libcamera: ipu3: imgu: Configure the stat video device as part of configure()
diff mbox series

Message ID 20201229160318.77536-3-niklas.soderlund@ragnatech.se
State Superseded
Delegated to: Niklas Söderlund
Headers show
Series
  • libcamera: ipu3: Attach to an skeleton IPA
Related show

Commit Message

Niklas Söderlund Dec. 29, 2020, 4:03 p.m. UTC
There is no reason to expose and call a separate configureStat() when
the statistics video device can be configured with the exact same
parameters as part of configure(). Move the configuration internally to
the ImgUDevice simplifying the interface, there is no functional change.

Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/pipeline/ipu3/imgu.cpp |  7 +++++++
 src/libcamera/pipeline/ipu3/imgu.h   |  7 -------
 src/libcamera/pipeline/ipu3/ipu3.cpp | 11 -----------
 3 files changed, 7 insertions(+), 18 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp
index 5b1c0318b42695b7..08f0fce9d740963f 100644
--- a/src/libcamera/pipeline/ipu3/imgu.cpp
+++ b/src/libcamera/pipeline/ipu3/imgu.cpp
@@ -475,6 +475,13 @@  int ImgUDevice::configure(const PipeConfig &pipeConfig, V4L2DeviceFormat *inputF
 
 	LOG(IPU3, Debug) << "ImgU GDC format = " << gdcFormat.toString();
 
+	StreamConfiguration statCfg = {};
+	statCfg.size = inputFormat->size;
+	V4L2DeviceFormat statFormat;
+	ret = configureVideoDevice(stat_.get(), PAD_STAT, statCfg, &statFormat);
+	if (ret)
+		return ret;
+
 	return 0;
 }
 
diff --git a/src/libcamera/pipeline/ipu3/imgu.h b/src/libcamera/pipeline/ipu3/imgu.h
index c73ac5a5a37cfe0e..37f5ae77c99ff8fe 100644
--- a/src/libcamera/pipeline/ipu3/imgu.h
+++ b/src/libcamera/pipeline/ipu3/imgu.h
@@ -61,13 +61,6 @@  public:
 					    outputFormat);
 	}
 
-	int configureStat(const StreamConfiguration &cfg,
-			  V4L2DeviceFormat *outputFormat)
-	{
-		return configureVideoDevice(stat_.get(), PAD_STAT, cfg,
-					    outputFormat);
-	}
-
 	int allocateBuffers(unsigned int bufferCount);
 	void freeBuffers();
 
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index f1151733d9fe81ff..3e0e88fa63c4f1fb 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -518,17 +518,6 @@  int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
 			return ret;
 	}
 
-	/*
-	 * Apply the largest available format to the stat node.
-	 * \todo Revise this when we'll actually use the stat node.
-	 */
-	StreamConfiguration statCfg = {};
-	statCfg.size = cio2Format.size;
-
-	ret = imgu->configureStat(statCfg, &outputFormat);
-	if (ret)
-		return ret;
-
 	/* Apply the "pipe_mode" control to the ImgU subdevice. */
 	ControlList ctrls(imgu->imgu_->controls());
 	ctrls.set(V4L2_CID_IPU3_PIPE_MODE,