[libcamera-devel,v3,6/8] libcamera: ipu3: imgu: Fix BSD height size comparison
diff mbox series

Message ID 20210513152116.17666-7-jacopo@jmondi.org
State Accepted
Commit 5be6313d325a91e47251b831ee7c33a3e58c0cfb
Delegated to: Jacopo Mondi
Headers show
Series
  • ipu3: imgu: Improve ImgU calculation procedure
Related show

Commit Message

Jacopo Mondi May 13, 2021, 3:21 p.m. UTC
Fix a size comparison when iterating on the BDS sizes to accepts
values that are equal to the minimum accepted height.

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>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
---
 src/libcamera/pipeline/ipu3/imgu.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Hirokazu Honda May 17, 2021, 3:59 a.m. UTC | #1
Hi Jacopo, thank you for the patch.

On Fri, May 14, 2021 at 12:20 AM Jacopo Mondi <jacopo@jmondi.org> wrote:

> Fix a size comparison when iterating on the BDS sizes to accepts
> values that are equal to the minimum accepted height.
>
> 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>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
>

Reviewed-by: Hirokazu Honda <hiroh@chromium.org>

>

> ---
>  src/libcamera/pipeline/ipu3/imgu.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp
> b/src/libcamera/pipeline/ipu3/imgu.cpp
> index 5912ae4dfc87..df5a1b5b0826 100644
> --- a/src/libcamera/pipeline/ipu3/imgu.cpp
> +++ b/src/libcamera/pipeline/ipu3/imgu.cpp
> @@ -177,7 +177,7 @@ void calculateBDSHeight(ImgUDevice::Pipe *pipe, const
> Size &iif, const Size &gdc
>                 }
>         } else {
>                 ifHeight = utils::alignUp(iif.height, IF_ALIGN_H);
> -               while (ifHeight > minIFHeight && ifHeight / bdsSF >=
> minBDSHeight) {
> +               while (ifHeight >= minIFHeight && ifHeight / bdsSF >=
> minBDSHeight) {
>
>                         bdsHeight = ifHeight / bdsSF;
>                         if (std::fmod(ifHeight, 1.0) == 0 &&
> std::fmod(bdsHeight, 1.0) == 0) {
> --
> 2.31.1
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
>

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp
index 5912ae4dfc87..df5a1b5b0826 100644
--- a/src/libcamera/pipeline/ipu3/imgu.cpp
+++ b/src/libcamera/pipeline/ipu3/imgu.cpp
@@ -177,7 +177,7 @@  void calculateBDSHeight(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc
 		}
 	} else {
 		ifHeight = utils::alignUp(iif.height, IF_ALIGN_H);
-		while (ifHeight > minIFHeight && ifHeight / bdsSF >= minBDSHeight) {
+		while (ifHeight >= minIFHeight && ifHeight / bdsSF >= minBDSHeight) {
 
 			bdsHeight = ifHeight / bdsSF;
 			if (std::fmod(ifHeight, 1.0) == 0 && std::fmod(bdsHeight, 1.0) == 0) {