<div dir="ltr"><div dir="ltr">Hi Jacopo, thank you for the patch,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, May 3, 2021 at 7:56 PM Niklas Söderlund <<a href="mailto:niklas.soderlund@ragnatech.se">niklas.soderlund@ragnatech.se</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Jacopo,<br>
<br>
Thanks for your patch.<br>
<br>
On 2021-05-03 11:27:00 +0200, Jacopo Mondi wrote:<br>
> Apply to calculateBDS() function the content of commit 243d134 ("Fix<br>
> some bug for some resolutions") from<br>
> <a href="https://github.com/intel/intel-ipu3-pipecfg.git" rel="noreferrer" target="_blank">https://github.com/intel/intel-ipu3-pipecfg.git</a>.<br>
> <br>
> The calculated BDS sizes are filtered by height and not only by width<br>
> anymore.<br>
> <br>
> Tested-by: Jean-Michel Hautbois <<a href="mailto:jeanmichel.hautbois@ideasonboard.com" target="_blank">jeanmichel.hautbois@ideasonboard.com</a>><br>
> Reviewed-by: Jean-Michel Hautbois <<a href="mailto:jeanmichel.hautbois@ideasonboard.com" target="_blank">jeanmichel.hautbois@ideasonboard.com</a>><br>
> Signed-off-by: Jacopo Mondi <<a href="mailto:jacopo@jmondi.org" target="_blank">jacopo@jmondi.org</a>><br>
<br>
Acked-by: Niklas Söderlund <<a href="mailto:niklas.soderlund@ragnatech.se" target="_blank">niklas.soderlund@ragnatech.se</a>><br>
<br>
> ---<br>
> src/libcamera/pipeline/ipu3/imgu.cpp | 20 +++++++++++++++-----<br>
> 1 file changed, 15 insertions(+), 5 deletions(-)<br>
> <br>
> diff --git a/src/libcamera/pipeline/ipu3/imgu.cpp b/src/libcamera/pipeline/ipu3/imgu.cpp<br>
> index 8373dc165a61..36fee31c1962 100644<br>
> --- a/src/libcamera/pipeline/ipu3/imgu.cpp<br>
> +++ b/src/libcamera/pipeline/ipu3/imgu.cpp<br>
> @@ -33,6 +33,7 @@ namespace {<br>
> * at revision: 61e83f2f7606 ("Add more information into README")<br>
> */<br>
> <br>
> +static constexpr unsigned int FILTER_W = 4;<br>
> static constexpr unsigned int FILTER_H = 4;<br>
> </blockquote><div><br></div><div>Would you mind adding comments about these const variables in another patch?</div><div>By the way, static is unnecessary to the variables.</div><div> </div><div>Reviewed-by: Hirokazu Honda <<a href="mailto:hiroh@chromium.org">hiroh@chromium.org</a>></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> <br>
> static constexpr unsigned int IF_ALIGN_W = 2;<br>
> @@ -194,15 +195,20 @@ void calculateBDSHeight(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc<br>
> <br>
> void calculateBDS(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc, float bdsSF)<br>
> {<br>
> - unsigned int minBDSWidth = gdc.width + FILTER_H * 2;<br>
> + unsigned int minBDSWidth = gdc.width + FILTER_W * 2;<br>
> + unsigned int minBDSHeight = gdc.height + FILTER_H * 2;<br>
> <br>
> float sf = bdsSF;<br>
> while (sf <= BDS_SF_MAX && sf >= BDS_SF_MIN) {<br>
> float bdsWidth = static_cast<float>(iif.width) / sf;<br>
> + float bdsHeight = static_cast<float>(iif.height) / sf;<br>
> <br>
> - if (std::fmod(bdsWidth, 1.0) == 0) {<br>
> + if (std::fmod(bdsWidth, 1.0) == 0 &&<br>
> + std::fmod(bdsHeight, 1.0) == 0) {<br>
> unsigned int bdsIntWidth = static_cast<unsigned int>(bdsWidth);<br>
> - if (!(bdsIntWidth % BDS_ALIGN_W) && bdsWidth >= minBDSWidth)<br>
> + unsigned int bdsIntHeight = static_cast<unsigned int>(bdsHeight);<br>
> + if (!(bdsIntWidth % BDS_ALIGN_W) && bdsWidth >= minBDSWidth &&<br>
> + !(bdsIntHeight % BDS_ALIGN_H) && bdsHeight >= minBDSHeight)<br>
> calculateBDSHeight(pipe, iif, gdc, bdsIntWidth, sf);<br>
> }<br>
> <br>
> @@ -212,10 +218,14 @@ void calculateBDS(ImgUDevice::Pipe *pipe, const Size &iif, const Size &gdc, floa<br>
> sf = bdsSF;<br>
> while (sf <= BDS_SF_MAX && sf >= BDS_SF_MIN) {<br>
> float bdsWidth = static_cast<float>(iif.width) / sf;<br>
> + float bdsHeight = static_cast<float>(iif.height) / sf;<br>
> <br>
> - if (std::fmod(bdsWidth, 1.0) == 0) {<br>
> + if (std::fmod(bdsWidth, 1.0) == 0 &&<br>
> + std::fmod(bdsHeight, 1.0) == 0) {<br>
> unsigned int bdsIntWidth = static_cast<unsigned int>(bdsWidth);<br>
> - if (!(bdsIntWidth % BDS_ALIGN_W) && bdsWidth >= minBDSWidth)<br>
> + unsigned int bdsIntHeight = static_cast<unsigned int>(bdsHeight);<br>
> + if (!(bdsIntWidth % BDS_ALIGN_W) && bdsWidth >= minBDSWidth &&<br>
> + !(bdsIntHeight % BDS_ALIGN_H) && bdsHeight >= minBDSHeight)<br>
> calculateBDSHeight(pipe, iif, gdc, bdsIntWidth, sf);<br>
> }<br>
> <br>
> -- <br>
> 2.31.1<br>
> <br>
> _______________________________________________<br>
> libcamera-devel mailing list<br>
> <a href="mailto:libcamera-devel@lists.libcamera.org" target="_blank">libcamera-devel@lists.libcamera.org</a><br>
> <a href="https://lists.libcamera.org/listinfo/libcamera-devel" rel="noreferrer" target="_blank">https://lists.libcamera.org/listinfo/libcamera-devel</a><br>
<br>
-- <br>
Regards,<br>
Niklas Söderlund<br>
_______________________________________________<br>
libcamera-devel mailing list<br>
<a href="mailto:libcamera-devel@lists.libcamera.org" target="_blank">libcamera-devel@lists.libcamera.org</a><br>
<a href="https://lists.libcamera.org/listinfo/libcamera-devel" rel="noreferrer" target="_blank">https://lists.libcamera.org/listinfo/libcamera-devel</a><br>
</blockquote></div></div>