[v2] pipeline: rpi: always initialize the embedded buffer in tryRunPipeline
diff mbox series

Message ID 20240122133332.64190-1-mail@eliasnaur.com
State Accepted
Commit 0dc737d3e31112973c9286eb7775b8f730352a75
Headers show
Series
  • [v2] pipeline: rpi: always initialize the embedded buffer in tryRunPipeline
Related show

Commit Message

Elias Naur Jan. 22, 2024, 1:33 p.m. UTC
Vc4CameraData::findMatchBuffers may return successfully with a null
embedded buffer, in which case the embedded buffer id would be left
uninitialized.

Without this change, libcamera v0.2.0 usually crashes for me with an
assertion error:

 ipa_base.cpp:397 assertion "it != buffers_.end()" failed in prepareIsp()

Signed-off-by: Elias Naur <mail@eliasnaur.com>
---
 src/libcamera/pipeline/rpi/vc4/vc4.cpp | 1 +
 1 file changed, 1 insertion(+)

Comments

Laurent Pinchart Jan. 22, 2024, 2:31 p.m. UTC | #1
On Mon, Jan 22, 2024 at 08:33:10AM -0500, Elias Naur wrote:
> Vc4CameraData::findMatchBuffers may return successfully with a null
> embedded buffer, in which case the embedded buffer id would be left
> uninitialized.
> 
> Without this change, libcamera v0.2.0 usually crashes for me with an
> assertion error:
> 
>  ipa_base.cpp:397 assertion "it != buffers_.end()" failed in prepareIsp()
> 
> Signed-off-by: Elias Naur <mail@eliasnaur.com>

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

And I'll add the

Reviewed-by: Naushir Patuck <naush@raspberrypi.com>

that Naush sent for v1.

> ---
>  src/libcamera/pipeline/rpi/vc4/vc4.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
> index 26102ea7..a52f0e7a 100644
> --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp
> +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
> @@ -945,6 +945,7 @@ void Vc4CameraData::tryRunPipeline()
>  	params.requestControls = request->controls();
>  	params.ipaContext = request->sequence();
>  	params.delayContext = bayerFrame.delayContext;
> +	params.buffers.embedded = 0;
>  
>  	if (embeddedBuffer) {
>  		unsigned int embeddedId = unicam_[Unicam::Embedded].getBufferId(embeddedBuffer);

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
index 26102ea7..a52f0e7a 100644
--- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp
+++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp
@@ -945,6 +945,7 @@  void Vc4CameraData::tryRunPipeline()
 	params.requestControls = request->controls();
 	params.ipaContext = request->sequence();
 	params.delayContext = bayerFrame.delayContext;
+	params.buffers.embedded = 0;
 
 	if (embeddedBuffer) {
 		unsigned int embeddedId = unicam_[Unicam::Embedded].getBufferId(embeddedBuffer);