[v3,04/18] libcamera: ipu3: Formatting improvements
diff mbox series

Message ID 20240902154212.1281257-5-mzamazal@redhat.com
State Accepted
Headers show
Series
  • Remove unused includes
Related show

Commit Message

Milan Zamazal Sept. 2, 2024, 3:41 p.m. UTC
The LSP autoformatter doesn't like some of the current formatting, let's
make it happier.  Note that not all of its suggestions were accepted
because readability is preferred and adjusting .clang-format may not be
easy or possible.

Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
---
 src/ipa/ipu3/algorithms/agc.cpp      |  2 +-
 src/ipa/ipu3/algorithms/blc.cpp      |  4 ++--
 src/ipa/ipu3/ipu3.cpp                | 11 ++++++-----
 src/libcamera/pipeline/ipu3/ipu3.cpp | 17 +++++++++--------
 4 files changed, 18 insertions(+), 16 deletions(-)

Comments

Laurent Pinchart Sept. 2, 2024, 6:34 p.m. UTC | #1
Hi Milan,

Thank you for the patch.

On Mon, Sep 02, 2024 at 05:41:57PM +0200, Milan Zamazal wrote:
> The LSP autoformatter doesn't like some of the current formatting, let's
> make it happier.  Note that not all of its suggestions were accepted
> because readability is preferred and adjusting .clang-format may not be
> easy or possible.
> 
> Signed-off-by: Milan Zamazal <mzamazal@redhat.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/ipa/ipu3/algorithms/agc.cpp      |  2 +-
>  src/ipa/ipu3/algorithms/blc.cpp      |  4 ++--
>  src/ipa/ipu3/ipu3.cpp                | 11 ++++++-----
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 17 +++++++++--------
>  4 files changed, 18 insertions(+), 16 deletions(-)
> 
> diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp
> index 3378c4fd..c5f3d8f0 100644
> --- a/src/ipa/ipu3/algorithms/agc.cpp
> +++ b/src/ipa/ipu3/algorithms/agc.cpp
> @@ -14,6 +14,7 @@
>  #include <libcamera/base/utils.h>
>  
>  #include <libcamera/control_ids.h>
> +
>  #include <libcamera/ipa/core_ipa_interface.h>
>  
>  #include "libipa/histogram.h"
> @@ -246,7 +247,6 @@ void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
>  	utils::Duration frameDuration = context.configuration.sensor.lineDuration
>  				      * vTotal;
>  	metadata.set(controls::FrameDuration, frameDuration.get<std::micro>());
> -
>  }
>  
>  REGISTER_IPA_ALGORITHM(Agc, "Agc")
> diff --git a/src/ipa/ipu3/algorithms/blc.cpp b/src/ipa/ipu3/algorithms/blc.cpp
> index fa4b9272..35748fb2 100644
> --- a/src/ipa/ipu3/algorithms/blc.cpp
> +++ b/src/ipa/ipu3/algorithms/blc.cpp
> @@ -55,8 +55,8 @@ void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,
>  	 * tuning processes. This is a first rough approximation.
>  	 */
>  	params->obgrid_param.gr = 64;
> -	params->obgrid_param.r  = 64;
> -	params->obgrid_param.b  = 64;
> +	params->obgrid_param.r = 64;
> +	params->obgrid_param.b = 64;
>  	params->obgrid_param.gb = 64;
>  
>  	/* Enable the custom black level correction processing */
> diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
> index 9dcc89ae..6ebf7c1d 100644
> --- a/src/ipa/ipu3/ipu3.cpp
> +++ b/src/ipa/ipu3/ipu3.cpp
> @@ -24,10 +24,11 @@
>  
>  #include <libcamera/control_ids.h>
>  #include <libcamera/framebuffer.h>
> +#include <libcamera/request.h>
> +
>  #include <libcamera/ipa/ipa_interface.h>
>  #include <libcamera/ipa/ipa_module_info.h>
>  #include <libcamera/ipa/ipu3_ipa_interface.h>
> -#include <libcamera/request.h>
>  
>  #include "libcamera/internal/mapped_framebuffer.h"
>  #include "libcamera/internal/yaml_parser.h"
> @@ -308,8 +309,8 @@ int IPAIPU3::init(const IPASettings &settings,
>  
>  	/* Clean context */
>  	context_.configuration = {};
> -	context_.configuration.sensor.lineDuration = sensorInfo.minLineLength
> -						   * 1.0s / sensorInfo.pixelRate;
> +	context_.configuration.sensor.lineDuration =
> +		sensorInfo.minLineLength * 1.0s / sensorInfo.pixelRate;
>  
>  	/* Load the tuning data file. */
>  	File file(settings.configurationFile);
> @@ -472,8 +473,8 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,
>  	context_.frameContexts.clear();
>  
>  	/* Initialise the sensor configuration. */
> -	context_.configuration.sensor.lineDuration = sensorInfo_.minLineLength
> -						   * 1.0s / sensorInfo_.pixelRate;
> +	context_.configuration.sensor.lineDuration =
> +		sensorInfo_.minLineLength * 1.0s / sensorInfo_.pixelRate;
>  	context_.configuration.sensor.size = sensorInfo_.outputSize;
>  
>  	/*
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index 29172f34..430aa902 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -18,12 +18,13 @@
>  #include <libcamera/camera.h>
>  #include <libcamera/control_ids.h>
>  #include <libcamera/formats.h>
> -#include <libcamera/ipa/ipu3_ipa_interface.h>
> -#include <libcamera/ipa/ipu3_ipa_proxy.h>
>  #include <libcamera/property_ids.h>
>  #include <libcamera/request.h>
>  #include <libcamera/stream.h>
>  
> +#include <libcamera/ipa/ipu3_ipa_interface.h>
> +#include <libcamera/ipa/ipu3_ipa_proxy.h>
> +
>  #include "libcamera/internal/camera.h"
>  #include "libcamera/internal/camera_lens.h"
>  #include "libcamera/internal/camera_sensor.h"
> @@ -1116,19 +1117,19 @@ int PipelineHandlerIPU3::registerCameras()
>  		 * returned through the ImgU main and secondary outputs.
>  		 */
>  		data->cio2_.bufferReady().connect(data.get(),
> -					&IPU3CameraData::cio2BufferReady);
> +						  &IPU3CameraData::cio2BufferReady);
>  		data->cio2_.bufferAvailable.connect(
>  			data.get(), &IPU3CameraData::queuePendingRequests);
>  		data->imgu_->input_->bufferReady.connect(&data->cio2_,
> -					&CIO2Device::tryReturnBuffer);
> +							 &CIO2Device::tryReturnBuffer);
>  		data->imgu_->output_->bufferReady.connect(data.get(),
> -					&IPU3CameraData::imguOutputBufferReady);
> +							  &IPU3CameraData::imguOutputBufferReady);
>  		data->imgu_->viewfinder_->bufferReady.connect(data.get(),
> -					&IPU3CameraData::imguOutputBufferReady);
> +							      &IPU3CameraData::imguOutputBufferReady);
>  		data->imgu_->param_->bufferReady.connect(data.get(),
> -					&IPU3CameraData::paramBufferReady);
> +							 &IPU3CameraData::paramBufferReady);
>  		data->imgu_->stat_->bufferReady.connect(data.get(),
> -					&IPU3CameraData::statBufferReady);
> +							&IPU3CameraData::statBufferReady);
>  
>  		/* Create and register the Camera instance. */
>  		const std::string &cameraId = cio2->sensor()->id();

Patch
diff mbox series

diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp
index 3378c4fd..c5f3d8f0 100644
--- a/src/ipa/ipu3/algorithms/agc.cpp
+++ b/src/ipa/ipu3/algorithms/agc.cpp
@@ -14,6 +14,7 @@ 
 #include <libcamera/base/utils.h>
 
 #include <libcamera/control_ids.h>
+
 #include <libcamera/ipa/core_ipa_interface.h>
 
 #include "libipa/histogram.h"
@@ -246,7 +247,6 @@  void Agc::process(IPAContext &context, [[maybe_unused]] const uint32_t frame,
 	utils::Duration frameDuration = context.configuration.sensor.lineDuration
 				      * vTotal;
 	metadata.set(controls::FrameDuration, frameDuration.get<std::micro>());
-
 }
 
 REGISTER_IPA_ALGORITHM(Agc, "Agc")
diff --git a/src/ipa/ipu3/algorithms/blc.cpp b/src/ipa/ipu3/algorithms/blc.cpp
index fa4b9272..35748fb2 100644
--- a/src/ipa/ipu3/algorithms/blc.cpp
+++ b/src/ipa/ipu3/algorithms/blc.cpp
@@ -55,8 +55,8 @@  void BlackLevelCorrection::prepare([[maybe_unused]] IPAContext &context,
 	 * tuning processes. This is a first rough approximation.
 	 */
 	params->obgrid_param.gr = 64;
-	params->obgrid_param.r  = 64;
-	params->obgrid_param.b  = 64;
+	params->obgrid_param.r = 64;
+	params->obgrid_param.b = 64;
 	params->obgrid_param.gb = 64;
 
 	/* Enable the custom black level correction processing */
diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
index 9dcc89ae..6ebf7c1d 100644
--- a/src/ipa/ipu3/ipu3.cpp
+++ b/src/ipa/ipu3/ipu3.cpp
@@ -24,10 +24,11 @@ 
 
 #include <libcamera/control_ids.h>
 #include <libcamera/framebuffer.h>
+#include <libcamera/request.h>
+
 #include <libcamera/ipa/ipa_interface.h>
 #include <libcamera/ipa/ipa_module_info.h>
 #include <libcamera/ipa/ipu3_ipa_interface.h>
-#include <libcamera/request.h>
 
 #include "libcamera/internal/mapped_framebuffer.h"
 #include "libcamera/internal/yaml_parser.h"
@@ -308,8 +309,8 @@  int IPAIPU3::init(const IPASettings &settings,
 
 	/* Clean context */
 	context_.configuration = {};
-	context_.configuration.sensor.lineDuration = sensorInfo.minLineLength
-						   * 1.0s / sensorInfo.pixelRate;
+	context_.configuration.sensor.lineDuration =
+		sensorInfo.minLineLength * 1.0s / sensorInfo.pixelRate;
 
 	/* Load the tuning data file. */
 	File file(settings.configurationFile);
@@ -472,8 +473,8 @@  int IPAIPU3::configure(const IPAConfigInfo &configInfo,
 	context_.frameContexts.clear();
 
 	/* Initialise the sensor configuration. */
-	context_.configuration.sensor.lineDuration = sensorInfo_.minLineLength
-						   * 1.0s / sensorInfo_.pixelRate;
+	context_.configuration.sensor.lineDuration =
+		sensorInfo_.minLineLength * 1.0s / sensorInfo_.pixelRate;
 	context_.configuration.sensor.size = sensorInfo_.outputSize;
 
 	/*
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 29172f34..430aa902 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -18,12 +18,13 @@ 
 #include <libcamera/camera.h>
 #include <libcamera/control_ids.h>
 #include <libcamera/formats.h>
-#include <libcamera/ipa/ipu3_ipa_interface.h>
-#include <libcamera/ipa/ipu3_ipa_proxy.h>
 #include <libcamera/property_ids.h>
 #include <libcamera/request.h>
 #include <libcamera/stream.h>
 
+#include <libcamera/ipa/ipu3_ipa_interface.h>
+#include <libcamera/ipa/ipu3_ipa_proxy.h>
+
 #include "libcamera/internal/camera.h"
 #include "libcamera/internal/camera_lens.h"
 #include "libcamera/internal/camera_sensor.h"
@@ -1116,19 +1117,19 @@  int PipelineHandlerIPU3::registerCameras()
 		 * returned through the ImgU main and secondary outputs.
 		 */
 		data->cio2_.bufferReady().connect(data.get(),
-					&IPU3CameraData::cio2BufferReady);
+						  &IPU3CameraData::cio2BufferReady);
 		data->cio2_.bufferAvailable.connect(
 			data.get(), &IPU3CameraData::queuePendingRequests);
 		data->imgu_->input_->bufferReady.connect(&data->cio2_,
-					&CIO2Device::tryReturnBuffer);
+							 &CIO2Device::tryReturnBuffer);
 		data->imgu_->output_->bufferReady.connect(data.get(),
-					&IPU3CameraData::imguOutputBufferReady);
+							  &IPU3CameraData::imguOutputBufferReady);
 		data->imgu_->viewfinder_->bufferReady.connect(data.get(),
-					&IPU3CameraData::imguOutputBufferReady);
+							      &IPU3CameraData::imguOutputBufferReady);
 		data->imgu_->param_->bufferReady.connect(data.get(),
-					&IPU3CameraData::paramBufferReady);
+							 &IPU3CameraData::paramBufferReady);
 		data->imgu_->stat_->bufferReady.connect(data.get(),
-					&IPU3CameraData::statBufferReady);
+							&IPU3CameraData::statBufferReady);
 
 		/* Create and register the Camera instance. */
 		const std::string &cameraId = cio2->sensor()->id();