From patchwork Thu Jul 20 12:48:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 18855 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id C2C14BDC71 for ; Thu, 20 Jul 2023 12:48:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 21B53628BC; Thu, 20 Jul 2023 14:48:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1689857309; bh=welsnO2wYJTCtEsd3yWaXdYIFc0rUOrYP5JF4QepJUM=; h=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=CwUF4pktB75fvip3swSwHSl/8ACSZGKIJNQXBJCzlzuh6DODg72D7hUX5TPzuQ0rP ew/PMe4i0+20u4pi0Xh7cDmW0bZvPxP/gFeQXGBwT2TPHXNnfbuVUAJ0VEjXNvZjRg IIv0WyRDe5ghvY0rGXNqHcF4ywW4MmQI4NnZk+9AsTAuaJU9uu0x8i2Q7kIyKiqgL8 Mil7cBiDqw2wYBpF/7loUmw5LZKDCni+JynYW+das95BR4tAL+NchngjMWYj8wboRh ZVVREP6FACFOhQlnUKGDk7hFADKdYijbp//tmzGLZcOz0gVqz6rn2E5LR64hKQC5Wn ztvGDdThU6cEA== Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9DD3D61E2A for ; Thu, 20 Jul 2023 14:48:26 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="JuFT+5WZ"; dkim-atps=neutral Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3fc0aecf107so5824425e9.2 for ; Thu, 20 Jul 2023 05:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1689857306; x=1690462106; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=uOiKJMreUHQjfWwpc3ZuF8FFnyUWgOZnli00QKTLaPs=; b=JuFT+5WZTVmh8UuYGPOOBH+0Z/OLHxUF0TsBxiSXKr50qcpdb4T+LvfRftPxjJyOAo +g3P0ffGEYyWl+CAJE/DDMS+2VqNBAkaR6hGsMfNeTeD/lzdfV/vh65FYa0lNJAFQkHB 7TRexDwqphsMcNDka2Sf2srsZMNfUf+tPblQDb/xYNCR+JiZkpL7AkktCTkfm5swa+C/ sJnvH8C8w2PLYXoXoGQnzgmRbTg1+dwE03Q9siJRY2Fk1e4OELsLy9B8Tne6T9QQJbeD UEQS+nh+9Olle135DSQ/3CkAmHsu81h8EuthPVKcFM6Y8bSAWsOwc5U8SkOpiXv8Qbos iCOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689857306; x=1690462106; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uOiKJMreUHQjfWwpc3ZuF8FFnyUWgOZnli00QKTLaPs=; b=U0GP8Z5wlgUH2MujqqwKLZ6AOSI8ez365zEzEQ/2fN2UTZW2hW/hI22j1mbdhWQfKS B0DRZbnsRqeCG7dWFfXSGaGitQd08YX52DQemmFsbrUdUToa532qd0x6PkPzPNooeQAc cIujkHHEjcxQ2VrLf3VaU3f5AOWoqdFC7IZ+ueCVEVWhbKZVV0Mn0pqedtbdazWOHNNH +B+9t/D72QnPIuXQbO7kKT9zsI7T/pL3G4jEvcA7tOzmSVkJf/EwrVW+gmomQhRsnYws opmJlGSLPUD1vL4DozD4fippgFgWF+9cGoY8vGbALYC95xvl5scwul2nC+I8j92nwHX9 +kRQ== X-Gm-Message-State: ABy/qLbYx/MbOO0CQ8toRn9O1gg0gacWG1+b45e2JkQ5tNJQTT4onfMN ywSPrsWdvnoagb4EYpJgYy7iuq4i/w8qWPIZe+M= X-Google-Smtp-Source: APBJJlGClMZPx5QPukL6ng6wOTnHuYFmLeCCL1t3gpPJ8KzxVReZUSXZisxplnMdmtyHvgEWZZru1A== X-Received: by 2002:a05:600c:b4b:b0:3fc:9b:9e85 with SMTP id k11-20020a05600c0b4b00b003fc009b9e85mr1727532wmr.18.1689857305750; Thu, 20 Jul 2023 05:48:25 -0700 (PDT) Received: from pi4-davidp.pitowers.org ([2a00:1098:3142:14:2bce:64d6:1a5c:49a2]) by smtp.gmail.com with ESMTPSA id d11-20020a1c730b000000b003fc00892c13sm1094618wmb.35.2023.07.20.05.48.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Jul 2023 05:48:25 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 20 Jul 2023 13:48:23 +0100 Message-Id: <20230720124823.14818-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] ipa: rpi: Fix the reporting of Focus FoMs X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: David Plowman via libcamera-devel From: David Plowman Reply-To: David Plowman Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" 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 Reviewed-by: Naushir Patuck Reviewed-by: Kieran Bingham Reviewed-by: Laurent Pinchart --- 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 ¶ms) 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); }