[v1,4/5] ipa: rkisp1: ccm: Fix ccm metadata output
diff mbox series

Message ID 20240712143227.3036702-5-stefan.klug@ideasonboard.com
State Accepted
Headers show
Series
  • A few fixes for the rkisp1 ipa
Related show

Commit Message

Stefan Klug July 12, 2024, 2:32 p.m. UTC
Only the first three entries of the matrix were set. Fix that.

Fixes: cbfdfa42cacc ("ipa: rkisp1: algorithms: Add crosstalk algorithm")
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
---
 src/ipa/rkisp1/algorithms/ccm.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dan Scally July 12, 2024, 3:30 p.m. UTC | #1
Hi Stefan

On 12/07/2024 15:32, Stefan Klug wrote:
> Only the first three entries of the matrix were set. Fix that.
>
> Fixes: cbfdfa42cacc ("ipa: rkisp1: algorithms: Add crosstalk algorithm")
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> ---


Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>

>   src/ipa/rkisp1/algorithms/ccm.cpp | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp
> index c1f5403a8ab2..4c4e3f5029a4 100644
> --- a/src/ipa/rkisp1/algorithms/ccm.cpp
> +++ b/src/ipa/rkisp1/algorithms/ccm.cpp
> @@ -135,7 +135,7 @@ void Ccm::process([[maybe_unused]] IPAContext &context,
>   	float m[9];
>   	for (unsigned int i = 0; i < 3; i++) {
>   		for (unsigned int j = 0; j < 3; j++)
> -			m[i] = frameContext.ccm.ccm[i][j];
> +			m[i * 3 + j] = frameContext.ccm.ccm[i][j];
>   	}
>   	metadata.set(controls::ColourCorrectionMatrix, m);
>   }
Kieran Bingham July 15, 2024, 2:45 a.m. UTC | #2
Quoting Stefan Klug (2024-07-12 15:32:05)
> Only the first three entries of the matrix were set. Fix that.
> 
> Fixes: cbfdfa42cacc ("ipa: rkisp1: algorithms: Add crosstalk algorithm")
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
> ---
>  src/ipa/rkisp1/algorithms/ccm.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp
> index c1f5403a8ab2..4c4e3f5029a4 100644
> --- a/src/ipa/rkisp1/algorithms/ccm.cpp
> +++ b/src/ipa/rkisp1/algorithms/ccm.cpp
> @@ -135,7 +135,7 @@ void Ccm::process([[maybe_unused]] IPAContext &context,
>         float m[9];
>         for (unsigned int i = 0; i < 3; i++) {
>                 for (unsigned int j = 0; j < 3; j++)
> -                       m[i] = frameContext.ccm.ccm[i][j];
> +                       m[i * 3 + j] = frameContext.ccm.ccm[i][j];
>         }

Ooops.

I wonder if we'll ever expose a const data() accessor to just read out
the underlying array. That would imply/expose the knoweledge of the
storage here though, But for now ...

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

>         metadata.set(controls::ColourCorrectionMatrix, m);
>  }
> -- 
> 2.43.0
>
Paul Elder July 19, 2024, 7:20 a.m. UTC | #3
On Fri, Jul 12, 2024 at 04:32:05PM +0200, Stefan Klug wrote:
> Only the first three entries of the matrix were set. Fix that.
> 
> Fixes: cbfdfa42cacc ("ipa: rkisp1: algorithms: Add crosstalk algorithm")
> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>

Oops...

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

> ---
>  src/ipa/rkisp1/algorithms/ccm.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp
> index c1f5403a8ab2..4c4e3f5029a4 100644
> --- a/src/ipa/rkisp1/algorithms/ccm.cpp
> +++ b/src/ipa/rkisp1/algorithms/ccm.cpp
> @@ -135,7 +135,7 @@ void Ccm::process([[maybe_unused]] IPAContext &context,
>  	float m[9];
>  	for (unsigned int i = 0; i < 3; i++) {
>  		for (unsigned int j = 0; j < 3; j++)
> -			m[i] = frameContext.ccm.ccm[i][j];
> +			m[i * 3 + j] = frameContext.ccm.ccm[i][j];
>  	}
>  	metadata.set(controls::ColourCorrectionMatrix, m);
>  }
> -- 
> 2.43.0
>

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/algorithms/ccm.cpp b/src/ipa/rkisp1/algorithms/ccm.cpp
index c1f5403a8ab2..4c4e3f5029a4 100644
--- a/src/ipa/rkisp1/algorithms/ccm.cpp
+++ b/src/ipa/rkisp1/algorithms/ccm.cpp
@@ -135,7 +135,7 @@  void Ccm::process([[maybe_unused]] IPAContext &context,
 	float m[9];
 	for (unsigned int i = 0; i < 3; i++) {
 		for (unsigned int j = 0; j < 3; j++)
-			m[i] = frameContext.ccm.ccm[i][j];
+			m[i * 3 + j] = frameContext.ccm.ccm[i][j];
 	}
 	metadata.set(controls::ColourCorrectionMatrix, m);
 }