[libcamera-devel] [PATCH v3 21/22] libcamera: vimc: Fill stride and frameSize at config validation

Laurent Pinchart laurent.pinchart at ideasonboard.com
Sun Jul 5 00:02:12 CEST 2020


Hi Paul,

Thank you for the patch.

On Sat, Jul 04, 2020 at 10:31:39PM +0900, Paul Elder wrote:
> Fill the stride and frameSize fields of the StreamConfiguration at
> configuration validation time instead of at camera configuration time.
> 
> Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
> 
> ---
> New in v3
> ---
>  src/libcamera/pipeline/vimc/vimc.cpp | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp
> index b653066..e55a861 100644
> --- a/src/libcamera/pipeline/vimc/vimc.cpp
> +++ b/src/libcamera/pipeline/vimc/vimc.cpp
> @@ -160,6 +160,10 @@ CameraConfiguration::Status VimcCameraConfiguration::validate()
>  
>  	cfg.bufferCount = 4;
>  
> +	const PixelFormatInfo &info = PixelFormatInfo::info(cfg.pixelFormat);
> +	cfg.stride = info.stride(cfg.size.width, 0);
> +	cfg.frameSize = info.frameSize(cfg.size);

You know what I'm going to say already :-) Please check the driver to
find the alignment constraints.

> +
>  	return status;
>  }
>  
> @@ -282,7 +286,6 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)
>  		return ret;
>  
>  	cfg.setStream(&data->stream_);
> -	cfg.stride = format.planes[0].bpl;
>  
>  	return 0;
>  }

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list