[libcamera-devel,7/9] libcamera: pipeline: raspberrypi: Fix bug in passing configuration to IPA

Message ID 20200713084727.232422-8-naush@raspberrypi.com
State Superseded
Headers show
Series
  • Zero-copy RAW stream work
Related show

Commit Message

Naushir Patuck July 13, 2020, 8:47 a.m. UTC
The counter was not incremented, so multiple streams would only pass the
last stream config to the IPA.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Comments

Niklas Söderlund July 13, 2020, 11:57 a.m. UTC | #1
Hi Naushir,

Thanks for your fix.

On 2020-07-13 09:47:26 +0100, Naushir Patuck wrote:
> The counter was not incremented, so multiple streams would only pass the
> last stream config to the IPA.
> 
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> index f7e16a6c..e1a74d89 100644
> --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
> @@ -848,12 +848,11 @@ int PipelineHandlerRPi::configureIPA(Camera *camera)
>  	/* Inform IPA of stream configuration and sensor controls. */
>  	unsigned int i = 0;
>  	for (auto const &stream : data->isp_) {
> -		if (stream.isExternal()) {
> -			streamConfig[i] = {
> +		if (stream.isExternal())
> +			streamConfig[i++] = {
>  				.pixelFormat = stream.configuration().pixelFormat,
>  				.size = stream.configuration().size
>  			};
> -		}
>  	}
>  	entityControls.emplace(0, data->unicam_[Unicam::Image].dev()->controls());
>  	entityControls.emplace(1, data->isp_[Isp::Input].dev()->controls());
> -- 
> 2.25.1
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch

diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index f7e16a6c..e1a74d89 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -848,12 +848,11 @@  int PipelineHandlerRPi::configureIPA(Camera *camera)
 	/* Inform IPA of stream configuration and sensor controls. */
 	unsigned int i = 0;
 	for (auto const &stream : data->isp_) {
-		if (stream.isExternal()) {
-			streamConfig[i] = {
+		if (stream.isExternal())
+			streamConfig[i++] = {
 				.pixelFormat = stream.configuration().pixelFormat,
 				.size = stream.configuration().size
 			};
-		}
 	}
 	entityControls.emplace(0, data->unicam_[Unicam::Image].dev()->controls());
 	entityControls.emplace(1, data->isp_[Isp::Input].dev()->controls());