[{"id":27595,"web_url":"https://patchwork.libcamera.org/comment/27595/","msgid":"<CAEmqJPpN+yd=0C_ezf2cwb19ME32wwc6eCoKyruu61fFASJQGA@mail.gmail.com>","date":"2023-07-21T08:04:03","subject":"Re: [libcamera-devel] [PATCH] ipa: rpi: Fix the reporting of Focus\n\tFoMs","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi David,\n\nThank you for this fix!\n\nOn Thu, 20 Jul 2023 at 13:48, David Plowman via libcamera-devel\n<libcamera-devel@lists.libcamera.org> wrote:\n>\n> The FocusFom metadata was no longer being reported back because the\n> \"focus.status\" metadata was never being created.\n>\n> Additionally, the scaling of the focus FoMs was over-zealous, rounding\n> just about everything down to zero.\n>\n> Fixes: ac7511dc4c59 (\"ipa: raspberrypi: Generalise the focus reporting code\")\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n> ---\n>  src/ipa/rpi/common/ipa_base.cpp | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n>\n> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> index f40f2e71..2a033264 100644\n> --- a/src/ipa/rpi/common/ipa_base.cpp\n> +++ b/src/ipa/rpi/common/ipa_base.cpp\n> @@ -458,6 +458,9 @@ void IpaBase::processStats(const ProcessParams &params)\n>\n>                 RPiController::StatisticsPtr statistics = platformProcessStats(it->second.planes()[0]);\n>\n> +               /* reportMetadata() will pick this up and set the FocusFoM metadata */\n> +               rpiMetadata.set(\"focus.status\", statistics->focusRegions);\n> +\n>                 helper_->process(statistics, rpiMetadata);\n>                 controller_.process(statistics, &rpiMetadata);\n>\n> @@ -1197,7 +1200,7 @@ void IpaBase::reportMetadata(unsigned int ipaContext)\n>                         }\n>                 }\n>\n> -               uint32_t focusFoM = (sum / numRegions) >> 16;\n> +               uint32_t focusFoM = sum / numRegions;\n>                 libcameraMetadata_.set(controls::FocusFoM, focusFoM);\n>         }\n>\n> --\n> 2.30.2\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CAC17BDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 21 Jul 2023 08:04:16 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D875361E29;\n\tFri, 21 Jul 2023 10:04:15 +0200 (CEST)","from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com\n\t[IPv6:2607:f8b0:4864:20::1134])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 49C1E61E28\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 Jul 2023 10:04:13 +0200 (CEST)","by mail-yw1-x1134.google.com with SMTP id\n\t00721157ae682-57026f4bccaso18001137b3.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 Jul 2023 01:04:13 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1689926655;\n\tbh=JTtnGScaipNTZWeJxum0f3ThQfCoJPeOouFSi0bSJXg=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=AFKL16T7tf5kTMLIz3tHa64s0rZqKgy3YJiQstj4kPSukijyJdJNLkoWetzZqDgLO\n\t5hgFU9IU7X4m78izZv2Hg2EjIPP4ydFtmICfnc1JX7XaeAEMB5VaWq/RK+ojjJo8iH\n\tXG5McTydVkUkEA5tTNEGE+CIINMbxO6Dnl6euZY3FiDHoRxijmZIbAhwyLIlIOgQMf\n\tmInebwHf+2+UD1lBwv+OUJ3K+P9bxrUTJwUxf6oZlDiQ5fkaK5HubuJ+0aGonUHEyt\n\tBcUYhOIm2j+P9eTiMXf74UtAsaNZTJcT7PuRiPtpuPsSbXA4R9KhrJukUlCKBYp3eK\n\tMX1XHC3FzAzdA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1689926652; x=1690531452;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=jJhDhB0y7yu1co3fsTP5A3yv08sqHMyQYnM9iMpdYBw=;\n\tb=kBQWgdXso9wqhv/nFgP8UFM60OK6BVtSM+SYVQIawZYn58lI5EgJl76YGmLKUCkpAb\n\tw3PwvGnl3nrwQyNgk84JktcOcA+UzTDPtNDy0sjnfDHufvNlXgcu4jfl4npIWF075I1t\n\tcR9ZqiRkQgz0aAWW56erDylsn2svdZXXe13Hj4pVAGW4acZBUy0tKgjJHnSq0mWpQ+k9\n\tWi2/0+nTv5vwICZXt8YjhnZElRi7Rl75G+YfQEqIeIndgMRbuSorF/A8sbLqNYxYKvej\n\tBHxRTBGvyErz7RKasa7fuguEtlecAYjXKep9uUQcPiZRgkzkNXV0U2LL496eeHs6VV4V\n\ticCw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"kBQWgdXs\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1689926652; x=1690531452;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=jJhDhB0y7yu1co3fsTP5A3yv08sqHMyQYnM9iMpdYBw=;\n\tb=PsRJpkJesP+nBVVaKh2OlWUbVYP4whIBbcCEbJY/O99SdJEvx+/mZlWSa1Q/bJpGaD\n\tC02fnnzT90PHIKDiMcRpNbQA9dEbMxwC5CvtgZNyv7AWvfryj0y3vTt/1yh7uZ65p82L\n\tilXq5kWAk7j0jpu+nNQxjlUQe3JIV4qUAc21wbS5x1G3xgp2QRxUoalpBZAhZkLrn4wN\n\toaTe9TScUSG1g84/a167cTpD3dejoXkTKRSW58oxH7F+Qur3FWBikXzky37CmwstmNCf\n\t8rH4pSYSxGT3I92Jk8RSBfT8DUGWpXjiP8y7l6u1RoaiXXRGKBmp33pdeVbaDNV73Za9\n\tRIbA==","X-Gm-Message-State":"ABy/qLZHiF1oddOTofzKO9iqBQIfrmHIkCIjj+HheoxfqJa6PRO74IfM\n\tgzJjcsBNTp1N7bEWpFckepGxf1N52P/4quQCF/fmVg==","X-Google-Smtp-Source":"APBJJlHp1PizMgeZpoZBrXcORcIRETODSxQW11L9ZG1HZeXLfY4m1AzGLi7aLDMJR23OLlN0UzOXjHGi1/aCs3XTRnQ=","X-Received":"by 2002:a81:c254:0:b0:579:effb:ae1c with SMTP id\n\tt20-20020a81c254000000b00579effbae1cmr1248891ywg.26.1689926651947;\n\tFri, 21 Jul 2023 01:04:11 -0700 (PDT)","MIME-Version":"1.0","References":"<20230720124823.14818-1-david.plowman@raspberrypi.com>","In-Reply-To":"<20230720124823.14818-1-david.plowman@raspberrypi.com>","Date":"Fri, 21 Jul 2023 09:04:03 +0100","Message-ID":"<CAEmqJPpN+yd=0C_ezf2cwb19ME32wwc6eCoKyruu61fFASJQGA@mail.gmail.com>","To":"David Plowman <david.plowman@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH] ipa: rpi: Fix the reporting of Focus\n\tFoMs","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27621,"web_url":"https://patchwork.libcamera.org/comment/27621/","msgid":"<169045280491.137962.7924518644245960300@Monstersaurus>","date":"2023-07-27T10:13:24","subject":"Re: [libcamera-devel] [PATCH] ipa: rpi: Fix the reporting of Focus\n\tFoMs","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting David Plowman via libcamera-devel (2023-07-20 13:48:23)\n> The FocusFom metadata was no longer being reported back because the\n> \"focus.status\" metadata was never being created.\n> \n> Additionally, the scaling of the focus FoMs was over-zealous, rounding\n> just about everything down to zero.\n> \n> Fixes: ac7511dc4c59 (\"ipa: raspberrypi: Generalise the focus reporting code\")\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> ---\n>  src/ipa/rpi/common/ipa_base.cpp | 5 ++++-\n>  1 file changed, 4 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> index f40f2e71..2a033264 100644\n> --- a/src/ipa/rpi/common/ipa_base.cpp\n> +++ b/src/ipa/rpi/common/ipa_base.cpp\n> @@ -458,6 +458,9 @@ void IpaBase::processStats(const ProcessParams &params)\n>  \n>                 RPiController::StatisticsPtr statistics = platformProcessStats(it->second.planes()[0]);\n>  \n> +               /* reportMetadata() will pick this up and set the FocusFoM metadata */\n> +               rpiMetadata.set(\"focus.status\", statistics->focusRegions);\n> +\n>                 helper_->process(statistics, rpiMetadata);\n>                 controller_.process(statistics, &rpiMetadata);\n>  \n> @@ -1197,7 +1200,7 @@ void IpaBase::reportMetadata(unsigned int ipaContext)\n>                         }\n>                 }\n>  \n> -               uint32_t focusFoM = (sum / numRegions) >> 16;\n> +               uint32_t focusFoM = sum / numRegions;\n\nThere's no specific units for this control anyway is there, so this\nstill seems reasonable. I wonder if we should have platforms scale the\nvalues to a defined range somehow - but I don't know what that range\nwould be or if it would make much difference anyway.\n\nBut having a usable value is better than not so...\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n>                 libcameraMetadata_.set(controls::FocusFoM, focusFoM);\n>         }\n>  \n> -- \n> 2.30.2\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 8E777BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Jul 2023 10:13:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B8966628C0;\n\tThu, 27 Jul 2023 12:13:28 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 91889600F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Jul 2023 12:13:27 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EE4C429A;\n\tThu, 27 Jul 2023 12:12:27 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1690452808;\n\tbh=CplAj+mCGUvHlOwqB5nsH5UnYFQkNrGO9kZQ/Fh1hGY=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=RIE+GW2/R9LAYWAnxJGU3sF7uxglSySNPyJry78RiqkC39wd8cgJnfajsuaXvnsxj\n\t7IdiR4SQckaQPRozGtuN6Cum64mXcj9qiQMRR0PhcktNxbTIE1ZOT4Fg7N/LNgN754\n\tZNFDZB089QJHfkNv2gfUYhhIcipWalMeE1VgZgZ7WjRjjL2dD/X2xpCxZNPQMZQKDO\n\toun0NF3pfjlgwcg3ITTkWe7eddTYrm/7h2jkD44w4dgVIby2YyWC8BZhhg0u0ZF3Th\n\tBSha/D07cQ7CKZaH3TM2Ntd6wn0yR423Yiv8MA/aLPs99d+yknlWb3T8V2n34LAO5n\n\tB0FyJbMzh4dqw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1690452748;\n\tbh=CplAj+mCGUvHlOwqB5nsH5UnYFQkNrGO9kZQ/Fh1hGY=;\n\th=In-Reply-To:References:Subject:From:To:Date:From;\n\tb=erDzRvnq4GPGhOFrwxiLphJx6a/J85ZjvcfY9Lu2oz+Mmenwfv9fB7Jox1qWeL8/M\n\t+GGAHHsw9an29kuWgBn/pR9l3EEg7nUDoVm1PT0tA/koPt/b/S8Oo/3Ns6jfAXyJ6P\n\tPdo6SElSnBoM0mG+3OcXYt3fs70ARbrHdzHidc7I="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"erDzRvnq\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230720124823.14818-1-david.plowman@raspberrypi.com>","References":"<20230720124823.14818-1-david.plowman@raspberrypi.com>","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 27 Jul 2023 11:13:24 +0100","Message-ID":"<169045280491.137962.7924518644245960300@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH] ipa: rpi: Fix the reporting of Focus\n\tFoMs","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27622,"web_url":"https://patchwork.libcamera.org/comment/27622/","msgid":"<CAHW6GYJhsbgFcEMon119hO4zrZBirmHr+Hfg-iAyHBLdMO7uUg@mail.gmail.com>","date":"2023-07-27T10:23:37","subject":"Re: [libcamera-devel] [PATCH] ipa: rpi: Fix the reporting of Focus\n\tFoMs","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Kieran\n\nThanks for the review!\n\nOn Thu, 27 Jul 2023 at 11:13, Kieran Bingham\n<kieran.bingham@ideasonboard.com> wrote:\n>\n> Quoting David Plowman via libcamera-devel (2023-07-20 13:48:23)\n> > The FocusFom metadata was no longer being reported back because the\n> > \"focus.status\" metadata was never being created.\n> >\n> > Additionally, the scaling of the focus FoMs was over-zealous, rounding\n> > just about everything down to zero.\n> >\n> > Fixes: ac7511dc4c59 (\"ipa: raspberrypi: Generalise the focus reporting code\")\n> > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> > ---\n> >  src/ipa/rpi/common/ipa_base.cpp | 5 ++++-\n> >  1 file changed, 4 insertions(+), 1 deletion(-)\n> >\n> > diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> > index f40f2e71..2a033264 100644\n> > --- a/src/ipa/rpi/common/ipa_base.cpp\n> > +++ b/src/ipa/rpi/common/ipa_base.cpp\n> > @@ -458,6 +458,9 @@ void IpaBase::processStats(const ProcessParams &params)\n> >\n> >                 RPiController::StatisticsPtr statistics = platformProcessStats(it->second.planes()[0]);\n> >\n> > +               /* reportMetadata() will pick this up and set the FocusFoM metadata */\n> > +               rpiMetadata.set(\"focus.status\", statistics->focusRegions);\n> > +\n> >                 helper_->process(statistics, rpiMetadata);\n> >                 controller_.process(statistics, &rpiMetadata);\n> >\n> > @@ -1197,7 +1200,7 @@ void IpaBase::reportMetadata(unsigned int ipaContext)\n> >                         }\n> >                 }\n> >\n> > -               uint32_t focusFoM = (sum / numRegions) >> 16;\n> > +               uint32_t focusFoM = sum / numRegions;\n>\n> There's no specific units for this control anyway is there, so this\n> still seems reasonable. I wonder if we should have platforms scale the\n> values to a defined range somehow - but I don't know what that range\n> would be or if it would make much difference anyway.\n>\n> But having a usable value is better than not so...\n\nYes, it is an utterly random unitless number that comes out of the\nhardware. It's basically the accumulated energy in the response of\nsome arbitrary sharpening filter, I think.\n\nThe most typical use case is to watch it while you twiddle your manual\nfocus lens, for which it's fine!\n\nThanks\nDavid\n\n>\n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n>\n> >                 libcameraMetadata_.set(controls::FocusFoM, focusFoM);\n> >         }\n> >\n> > --\n> > 2.30.2\n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CD3F8BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Jul 2023 10:23:51 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2A036628C0;\n\tThu, 27 Jul 2023 12:23:51 +0200 (CEST)","from mail-vs1-xe2b.google.com (mail-vs1-xe2b.google.com\n\t[IPv6:2607:f8b0:4864:20::e2b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0311F600F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Jul 2023 12:23:48 +0200 (CEST)","by mail-vs1-xe2b.google.com with SMTP id\n\tada2fe7eead31-440ad576d87so333231137.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Jul 2023 03:23:48 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1690453431;\n\tbh=TRt2a09GOYcJOpvIUX2iKDplOSdQx2TYGbMovhi+SJE=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=PoPZhej5IPSLqome0ygNjv84SkVDm4FjXbOh9yOpchi+qILr3t8tY6og9Y32Kodao\n\tAzFEv+acxMKosP9AzS86p9ozYmqoOeYw4XkWIqvboME0L6MpuGgOFIICb59KjdwqEd\n\tQZVVDXjGISgVgbo5iHM9ko3n7NnBwqxMllpSy1lO5OLzpBStCvG8SzKfEtXtw2vaj3\n\tgyLjriteV00ffKT2Z04zFTndlwIl3TsLusR6Khq2FVuIKJaUIXrXr5O1L2cBoMw1xQ\n\tW0t7qMEmv9acvUe2EqUvUH/tbvmNBNrETRIhgs9GaO/bVMdjisybs/UJ8tXU80JPT6\n\t5hs9NNlS4yNzQ==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1690453428; x=1691058228;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=OKmHtA5J+AEoCy6/9/8ZLk2JBK/j4YsHmHbsgv0r6cs=;\n\tb=TICW5OGseuaWXJy04cveiDELP4gpFQzT1vl/B5BXwfiv0bZNcMSFwQUi/MiHNR9omn\n\tI9nDzbpYJed38cuFmKfSTzVHaIcVK/MNVh8Ei2XZpG6XvvCOLpwyuRnII8gli2FfxB30\n\thHLFmoz63sIAa/sOCxKbGSPizjfO99h3Pkqtrhbs4U4wGKqvISIpYBffeGt1VpQdXCkF\n\tkvPa369ATo67Q63W4szI0Z+B910YGQj/CI6Sezlu//oN8ayRGJIwrrFcXkumJypf2iLB\n\to5q8z2R1PSt33lAAZB0xD6IF4xF/Imzu0iGuW1qnn9jjdfLaSgJiFmmdbZXTU7dkax0U\n\tIM1Q=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"TICW5OGs\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1690453428; x=1691058228;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=OKmHtA5J+AEoCy6/9/8ZLk2JBK/j4YsHmHbsgv0r6cs=;\n\tb=k6Bbj1VcKOsD7mcD61YqifGFYZvQbIBm8ZFwKUgfxR9rPc7DjxwKM3SGPJNbEWrsj6\n\t3YQFoJ4y7MtRVpNvm0bWmR9bkpp1q4JdbC8+NUU3Sq192uWhI0iMwz7eSKU2Wu96c/uM\n\tjoIvQksFlvsBb7Kdb9Wd2ayY3spcoXJVNWvk7U1I5Q6UB6O1McbKlcpZJB3VIEBkucsG\n\tCYyHSHnf3nk3ZRJM8I01bpWv2dl/fus+qr6Ku0eL+4lPYsNSitJTwY6Em3NJLH5kcAF+\n\tdW+QWQA1vQsG3rxtQbLXq5WnEFp4dyy5j764o6dIGjiNfQPDoHQH87K+7kW8GJGeX5pQ\n\tBvZw==","X-Gm-Message-State":"ABy/qLbtYC32YY3wfN2pzGj+3kAZaj2gwcWi6dKIEft9ttXmpwZDQoU3\n\t2PQFQHd8Q2q0RjTQzN7vFncW5jQQLCHpMPWQyLEk7Zt4dZyGgcJ9","X-Google-Smtp-Source":"APBJJlGzdUFzOkxE6OpS4MRsdR7CdqJj2uwawIO5rJceUTDtmv+oLXsq4Z8ZpVYvFb42BGABgTJODsLSYAdjDlVx8Kg=","X-Received":"by 2002:a67:ee4c:0:b0:440:cfc5:f91a with SMTP id\n\tg12-20020a67ee4c000000b00440cfc5f91amr1011869vsp.29.1690453427770;\n\tThu, 27 Jul 2023 03:23:47 -0700 (PDT)","MIME-Version":"1.0","References":"<20230720124823.14818-1-david.plowman@raspberrypi.com>\n\t<169045280491.137962.7924518644245960300@Monstersaurus>","In-Reply-To":"<169045280491.137962.7924518644245960300@Monstersaurus>","Date":"Thu, 27 Jul 2023 11:23:37 +0100","Message-ID":"<CAHW6GYJhsbgFcEMon119hO4zrZBirmHr+Hfg-iAyHBLdMO7uUg@mail.gmail.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH] ipa: rpi: Fix the reporting of Focus\n\tFoMs","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27626,"web_url":"https://patchwork.libcamera.org/comment/27626/","msgid":"<20230727210835.GL25174@pendragon.ideasonboard.com>","date":"2023-07-27T21:08:35","subject":"Re: [libcamera-devel] [PATCH] ipa: rpi: Fix the reporting of Focus\n\tFoMs","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi David,\n\nOn Thu, Jul 27, 2023 at 11:23:37AM +0100, David Plowman via libcamera-devel wrote:\n> On Thu, 27 Jul 2023 at 11:13, Kieran Bingham wrote:\n> > Quoting David Plowman via libcamera-devel (2023-07-20 13:48:23)\n> > > The FocusFom metadata was no longer being reported back because the\n> > > \"focus.status\" metadata was never being created.\n> > >\n> > > Additionally, the scaling of the focus FoMs was over-zealous, rounding\n> > > just about everything down to zero.\n> > >\n> > > Fixes: ac7511dc4c59 (\"ipa: raspberrypi: Generalise the focus reporting code\")\n> > > Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> > > ---\n> > >  src/ipa/rpi/common/ipa_base.cpp | 5 ++++-\n> > >  1 file changed, 4 insertions(+), 1 deletion(-)\n> > >\n> > > diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\n> > > index f40f2e71..2a033264 100644\n> > > --- a/src/ipa/rpi/common/ipa_base.cpp\n> > > +++ b/src/ipa/rpi/common/ipa_base.cpp\n> > > @@ -458,6 +458,9 @@ void IpaBase::processStats(const ProcessParams &params)\n> > >\n> > >                 RPiController::StatisticsPtr statistics = platformProcessStats(it->second.planes()[0]);\n> > >\n> > > +               /* reportMetadata() will pick this up and set the FocusFoM metadata */\n> > > +               rpiMetadata.set(\"focus.status\", statistics->focusRegions);\n> > > +\n> > >                 helper_->process(statistics, rpiMetadata);\n> > >                 controller_.process(statistics, &rpiMetadata);\n> > >\n> > > @@ -1197,7 +1200,7 @@ void IpaBase::reportMetadata(unsigned int ipaContext)\n> > >                         }\n> > >                 }\n> > >\n> > > -               uint32_t focusFoM = (sum / numRegions) >> 16;\n> > > +               uint32_t focusFoM = sum / numRegions;\n> >\n> > There's no specific units for this control anyway is there, so this\n> > still seems reasonable. I wonder if we should have platforms scale the\n> > values to a defined range somehow - but I don't know what that range\n> > would be or if it would make much difference anyway.\n> >\n> > But having a usable value is better than not so...\n> \n> Yes, it is an utterly random unitless number that comes out of the\n> hardware. It's basically the accumulated energy in the response of\n> some arbitrary sharpening filter, I think.\n> \n> The most typical use case is to watch it while you twiddle your manual\n> focus lens, for which it's fine!\n\nHaving no unit isn't an issue, but it would be useful to either report\nthe camera-specific minimum and maximum values, or scale the number to a\nrange set in the control documentation. Could this be done ?\n\nThis isn't a blocker for this patch, so\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> > Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n> >\n> > >                 libcameraMetadata_.set(controls::FocusFoM, focusFoM);\n> > >         }\n> > >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 20500BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Jul 2023 21:08:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 42BFE627D6;\n\tThu, 27 Jul 2023 23:08:32 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3A28E61EB0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Jul 2023 23:08:30 +0200 (CEST)","from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi\n\t[213.243.189.158])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E57E42E4;\n\tThu, 27 Jul 2023 23:07:29 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1690492112;\n\tbh=08rGoPHnGPQ1MeYcquOgSfIyegRoH8UzyvT3NvPpL/E=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=XIEbNHnWbBnu5ueWLpudWu6QbZvoIo9+exukWfuqb1sTQ/OvSs7J44mP2nv7NB9G9\n\tWOdBPVSEzFlN/gLUqKutrz+nmzpL4FM0CDDrMCHC3izLvPRq3DkegTlcF6820Hp90B\n\tQru5cTJEUWc23lXQNT/XzKtbjPcD8mQ6H8xbLatB7P3dci2ceK9RcUzv7MVMan+X5l\n\txPJbDHsVLXVKc1pVutiKotojLiLHSOmWmgdGnGThNwqFRu+QLEPcJeg2W53rYEDYnz\n\tN68IzIA+EAuA6ZWCosC+U7FbB6vtPMYqSL1xKAF8H6y8lRDxitRSMy/2IsjoKerkHL\n\twgX61Wf2AFJuw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1690492050;\n\tbh=08rGoPHnGPQ1MeYcquOgSfIyegRoH8UzyvT3NvPpL/E=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=ih2FscNUU8dHi1Sgz6ts3goa/GUINBpq2c3XUV83e4iaB2cuP8qW1n6+kz1nlz+4X\n\tV/TS7vxvOJb36DzFhDN/3Yf5Dpqd3/ONXJdpHA2zGeiEvyzVJbOYyTOagpKQ00dFOA\n\tX/q+Ajpv4nm9c35+TE+2Qo2Uakd5vVi5LMAcu1Ig="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ih2FscNU\"; dkim-atps=neutral","Date":"Fri, 28 Jul 2023 00:08:35 +0300","To":"David Plowman <david.plowman@raspberrypi.com>","Message-ID":"<20230727210835.GL25174@pendragon.ideasonboard.com>","References":"<20230720124823.14818-1-david.plowman@raspberrypi.com>\n\t<169045280491.137962.7924518644245960300@Monstersaurus>\n\t<CAHW6GYJhsbgFcEMon119hO4zrZBirmHr+Hfg-iAyHBLdMO7uUg@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAHW6GYJhsbgFcEMon119hO4zrZBirmHr+Hfg-iAyHBLdMO7uUg@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH] ipa: rpi: Fix the reporting of Focus\n\tFoMs","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]