The window set by SwStatsCpu::setWindow is relative to the processed image area. But debayering passes the processed line y-coordinate to the stats relative to the whole image area. This can result in gathering stats from a wrong image area or in not gathering stats at all. Let's pass the correct y-coordinate to the stats processing methods. Bug: https://bugs.libcamera.org/show_bug.cgi?id=280 Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name> Signed-off-by: Milan Zamazal <mzamazal@redhat.com> Reviewed-by: Hans de Goede <hansg@kernel.org> Tested-by: Hans de Goede <hansg@kernel.org> Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>