mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-21 15:53:54 +03:00
libcamera: pipeline: vimc: Fix configuration validation
The sensor aligns the width and height to multiples of two pixels, and the scaler has a x3 hardcoded factor. The output size must thus be aligned to 6 pixels, not 3. Fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
c671cbe622
commit
3bce337fbe
1 changed files with 7 additions and 3 deletions
|
@ -149,11 +149,15 @@ CameraConfiguration::Status VimcCameraConfiguration::validate()
|
|||
/* Clamp the size based on the device limits. */
|
||||
const Size size = cfg.size;
|
||||
|
||||
/* The scaler hardcodes a x3 scale-up ratio. */
|
||||
/*
|
||||
* The scaler hardcodes a x3 scale-up ratio, and the sensor output size
|
||||
* is aligned to two pixels in both directions. The output width and
|
||||
* height thus have to be multiples of 6.
|
||||
*/
|
||||
cfg.size.width = std::max(48U, std::min(4096U, cfg.size.width));
|
||||
cfg.size.height = std::max(48U, std::min(2160U, cfg.size.height));
|
||||
cfg.size.width -= cfg.size.width % 3;
|
||||
cfg.size.height -= cfg.size.height % 3;
|
||||
cfg.size.width -= cfg.size.width % 6;
|
||||
cfg.size.height -= cfg.size.height % 6;
|
||||
|
||||
if (cfg.size != size) {
|
||||
LOG(VIMC, Debug)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue