[v2,03/11] ipa: rkisp1: Pass parameters buffer format to IPA module
diff mbox series

Message ID 20240704162035.15074-4-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • rkisp1: Support BLS on i.MX8MP
Related show

Commit Message

Laurent Pinchart July 4, 2024, 4:20 p.m. UTC
The rkisp1 driver supports two formats for the ISP parameters buffer,
the legacy fixed format and the new extensible format. In preparation of
support for the new format, pass the parameters buffer format from the
pipeline handler to the IPA module and store it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
---
 include/libcamera/ipa/rkisp1.mojom       | 1 +
 src/ipa/rkisp1/rkisp1.cpp                | 2 ++
 src/libcamera/pipeline/rkisp1/rkisp1.cpp | 1 +
 3 files changed, 4 insertions(+)

Comments

Paul Elder July 5, 2024, 11:41 a.m. UTC | #1
On Thu, Jul 04, 2024 at 07:20:27PM +0300, Laurent Pinchart wrote:
> The rkisp1 driver supports two formats for the ISP parameters buffer,
> the legacy fixed format and the new extensible format. In preparation of
> support for the new format, pass the parameters buffer format from the
> pipeline handler to the IPA module and store it.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  include/libcamera/ipa/rkisp1.mojom       | 1 +
>  src/ipa/rkisp1/rkisp1.cpp                | 2 ++
>  src/libcamera/pipeline/rkisp1/rkisp1.cpp | 1 +
>  3 files changed, 4 insertions(+)
> 
> diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom
> index 1009e970a1b5..585d38572aa2 100644
> --- a/include/libcamera/ipa/rkisp1.mojom
> +++ b/include/libcamera/ipa/rkisp1.mojom
> @@ -11,6 +11,7 @@ import "include/libcamera/ipa/core.mojom";
>  struct IPAConfigInfo {
>  	libcamera.IPACameraSensorInfo sensorInfo;
>  	libcamera.ControlInfoMap sensorControls;
> +	uint32 paramFormat;
>  };
>  
>  interface IPARkISP1Interface {
> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
> index 23e0826cc335..71698bc47391 100644
> --- a/src/ipa/rkisp1/rkisp1.cpp
> +++ b/src/ipa/rkisp1/rkisp1.cpp
> @@ -79,6 +79,7 @@ private:
>  	std::map<unsigned int, MappedFrameBuffer> mappedBuffers_;
>  
>  	ControlInfoMap sensorControls_;
> +	uint32_t paramFormat_;
>  
>  	/* Local parameter storage */
>  	struct IPAContext context_;
> @@ -208,6 +209,7 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,
>  			 ControlInfoMap *ipaControls)
>  {
>  	sensorControls_ = ipaConfig.sensorControls;
> +	paramFormat_ = ipaConfig.paramFormat;
>  
>  	const auto itExp = sensorControls_.find(V4L2_CID_EXPOSURE);
>  	int32_t minExposure = itExp->second.min().get<int32_t>();
> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> index 4cbf105dbdcd..73e56b8fbf13 100644
> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
> @@ -819,6 +819,7 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
>  		return ret;
>  
>  	ipaConfig.sensorControls = data->sensor_->controls();
> +	ipaConfig.paramFormat = paramFormat.fourcc;
>  
>  	ret = data->ipa_->configure(ipaConfig, streamConfig, &data->controlInfo_);
>  	if (ret) {

Patch
diff mbox series

diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom
index 1009e970a1b5..585d38572aa2 100644
--- a/include/libcamera/ipa/rkisp1.mojom
+++ b/include/libcamera/ipa/rkisp1.mojom
@@ -11,6 +11,7 @@  import "include/libcamera/ipa/core.mojom";
 struct IPAConfigInfo {
 	libcamera.IPACameraSensorInfo sensorInfo;
 	libcamera.ControlInfoMap sensorControls;
+	uint32 paramFormat;
 };
 
 interface IPARkISP1Interface {
diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index 23e0826cc335..71698bc47391 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -79,6 +79,7 @@  private:
 	std::map<unsigned int, MappedFrameBuffer> mappedBuffers_;
 
 	ControlInfoMap sensorControls_;
+	uint32_t paramFormat_;
 
 	/* Local parameter storage */
 	struct IPAContext context_;
@@ -208,6 +209,7 @@  int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,
 			 ControlInfoMap *ipaControls)
 {
 	sensorControls_ = ipaConfig.sensorControls;
+	paramFormat_ = ipaConfig.paramFormat;
 
 	const auto itExp = sensorControls_.find(V4L2_CID_EXPOSURE);
 	int32_t minExposure = itExp->second.min().get<int32_t>();
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index 4cbf105dbdcd..73e56b8fbf13 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -819,6 +819,7 @@  int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
 		return ret;
 
 	ipaConfig.sensorControls = data->sensor_->controls();
+	ipaConfig.paramFormat = paramFormat.fourcc;
 
 	ret = data->ipa_->configure(ipaConfig, streamConfig, &data->controlInfo_);
 	if (ret) {