[libcamera-devel] [PATCH] libcamera: pipeline: ipu3: Fix compilation on gcc 5 and 6

Niklas Söderlund niklas.soderlund at ragnatech.se
Fri Mar 27 21:01:42 CET 2020


Hi Laurent,

Thanks for your patch.

On 2020-03-27 21:34:24 +0200, Laurent Pinchart wrote:
> Commit 5e7c5d64a67f ("libcamera: ipu3: Do not unconditionally queue
> buffers to CIO2") introduced usage of the std::queue default constructor
> by using copy-list-initialization from {}. The default constructor was
> explicit in C++11, which was fixed retroactively with a defect report
> (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0935r0.html).
> gcc 5 and 6 are unfortunately affected, requiring explicit usage of the
> constructor.
> 
> Fixes: 5e7c5d64a67f ("libcamera: ipu3: Do not unconditionally queue buffers to CIO2")
> Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index b490a801a9c4..1e114ca7ed10 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -1532,7 +1532,8 @@ int CIO2Device::allocateBuffers()
>  
>  void CIO2Device::freeBuffers()
>  {
> -	availableBuffers_ = {};
> +	/* The default std::queue constructor is explicit with gcc 5 and 6. */

I'm not sure the comment is needed, no biggie. With or without it,

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

> +	availableBuffers_ = std::queue<FrameBuffer *>{};
>  
>  	buffers_.clear();
>  
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel at lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

-- 
Regards,
Niklas Söderlund


More information about the libcamera-devel mailing list