[libcamera-devel,v2,5/7] libcamera: ipu3: imgu: Fix BSD height size comparison
diff mbox series

Message ID 20210503092705.15562-6-jacopo@jmondi.org
State Accepted
Delegated to: Jacopo Mondi
Headers show
Series
  • ipu3: imgu: Improve ImgU calculation procedure
Related show

Commit Message

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

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>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/libcamera/pipeline/ipu3/imgu.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Niklas Söderlund May 3, 2021, 10:53 a.m. UTC | #1
Hi Jacopo,

Thanks for your work.

On 2021-05-03 11:27:03 +0200, Jacopo Mondi wrote:
> Fix a size comparison when iterating on the BDS sizes to accepts
> values that are equal to the minimum accepted height.
> 
> 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>
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  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 feee2cc55abd..fa8cf7eeef19 100644
> --- a/src/libcamera/pipeline/ipu3/imgu.cpp
> +++ b/src/libcamera/pipeline/ipu3/imgu.cpp
> @@ -182,7 +182,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
Hirokazu Honda May 6, 2021, 5:56 a.m. UTC | #2
Hi Jacopo, thank you for the patch,

On Mon, May 3, 2021 at 7:53 PM Niklas Söderlund <
niklas.soderlund@ragnatech.se> wrote:

> Hi Jacopo,
>
> Thanks for your work.
>
> On 2021-05-03 11:27:03 +0200, Jacopo Mondi wrote:
> > Fix a size comparison when iterating on the BDS sizes to accepts
> > values that are equal to the minimum accepted height.
> >
> > 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>
> > Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
>
> 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 feee2cc55abd..fa8cf7eeef19 100644
> > --- a/src/libcamera/pipeline/ipu3/imgu.cpp
> > +++ b/src/libcamera/pipeline/ipu3/imgu.cpp
> > @@ -182,7 +182,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
>
> --
> Regards,
> Niklas Söderlund
> _______________________________________________
> 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 feee2cc55abd..fa8cf7eeef19 100644
--- a/src/libcamera/pipeline/ipu3/imgu.cpp
+++ b/src/libcamera/pipeline/ipu3/imgu.cpp
@@ -182,7 +182,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) {