[libcamera-devel] [PATCH] ipa: rpi: Fix the reporting of Focus FoMs

Naushir Patuck naush at raspberrypi.com
Fri Jul 21 10:04:03 CEST 2023


Hi David,

Thank you for this fix!

On Thu, 20 Jul 2023 at 13:48, David Plowman via libcamera-devel
<libcamera-devel at lists.libcamera.org> wrote:
>
> The FocusFom metadata was no longer being reported back because the
> "focus.status" metadata was never being created.
>
> Additionally, the scaling of the focus FoMs was over-zealous, rounding
> just about everything down to zero.
>
> Fixes: ac7511dc4c59 ("ipa: raspberrypi: Generalise the focus reporting code")
> Signed-off-by: David Plowman <david.plowman at raspberrypi.com>

Reviewed-by: Naushir Patuck <naush at raspberrypi.com>

> ---
>  src/ipa/rpi/common/ipa_base.cpp | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
> index f40f2e71..2a033264 100644
> --- a/src/ipa/rpi/common/ipa_base.cpp
> +++ b/src/ipa/rpi/common/ipa_base.cpp
> @@ -458,6 +458,9 @@ void IpaBase::processStats(const ProcessParams &params)
>
>                 RPiController::StatisticsPtr statistics = platformProcessStats(it->second.planes()[0]);
>
> +               /* reportMetadata() will pick this up and set the FocusFoM metadata */
> +               rpiMetadata.set("focus.status", statistics->focusRegions);
> +
>                 helper_->process(statistics, rpiMetadata);
>                 controller_.process(statistics, &rpiMetadata);
>
> @@ -1197,7 +1200,7 @@ void IpaBase::reportMetadata(unsigned int ipaContext)
>                         }
>                 }
>
> -               uint32_t focusFoM = (sum / numRegions) >> 16;
> +               uint32_t focusFoM = sum / numRegions;
>                 libcameraMetadata_.set(controls::FocusFoM, focusFoM);
>         }
>
> --
> 2.30.2
>


More information about the libcamera-devel mailing list