libcamera: ipu3: imgu: Fix IF height selection

Apply to calculateBDSHeight() function the first hunk of commit 243d134
("Fix some bug for some resolutions") from
https://github.com/intel/intel-ipu3-pipecfg.git.

The condition for the computed IF rectangle height to be matched
against the desired alignment now makes sure that it is included
in the minimum and maximum acceptable values.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Tested-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Acked-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
This commit is contained in:
Jacopo Mondi
2021-05-20 10:58:52 +02:00
parent 630c83f82a
commit 8f888a8e84
+4 -2
View File
@@ -135,7 +135,8 @@ void calculateBDSHeight(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc
estIFHeight = std::clamp<float>(estIFHeight, minIFHeight, iif.height);
ifHeight = utils::alignUp(estIFHeight, IF_ALIGN_H);
while (ifHeight >= minIFHeight && ifHeight / bdsSF >= minBDSHeight) {
while (ifHeight >= minIFHeight && ifHeight <= iif.height &&
ifHeight / bdsSF >= minBDSHeight) {
bdsHeight = ifHeight / bdsSF;
if (std::fmod(bdsHeight, 1.0) == 0) {
@@ -151,7 +152,8 @@ void calculateBDSHeight(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc
}
ifHeight = utils::alignUp(estIFHeight, IF_ALIGN_H);
while (ifHeight <= iif.height && ifHeight / bdsSF >= minBDSHeight) {
while (ifHeight >= minIFHeight && ifHeight <= iif.height &&
ifHeight / bdsSF >= minBDSHeight) {
bdsHeight = ifHeight / bdsSF;
if (std::fmod(bdsHeight, 1.0) == 0) {