From patchwork Thu Nov 26 14:50:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10512 X-Patchwork-Delegate: laurent.pinchart@ideasonboard.com 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 EC284BE08A for ; Thu, 26 Nov 2020 14:50:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 371E86346A; Thu, 26 Nov 2020 15:50:11 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="Vx6SzyaR"; dkim-atps=neutral Received: from mail-ej1-x644.google.com (mail-ej1-x644.google.com [IPv6:2a00:1450:4864:20::644]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1897B6346A for ; Thu, 26 Nov 2020 15:50:09 +0100 (CET) Received: by mail-ej1-x644.google.com with SMTP id f9so1103577ejw.4 for ; Thu, 26 Nov 2020 06:50:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3vIKDhkdBHpJGsSr1ppRdTN17fdllSE311fHIekkoBE=; b=Vx6SzyaRSLU+Zj9S5qkVkPku6Wu9PqPziXi52ZckY/mz9flxVzGI2Al2ENA6yBVDPp m/Fa+7O2gMLHYqV3BC6vigNO3R59nh1oapii3V1XjMfJVyGh5FjAUTSepXSfc9BXGJHX X71onq47BR4xrSSpXzDbx90ut824PvKGO7Dne5jt5ZoLaxsX1Vk3pvOXbodcU+XqE30z CpknEOJyDCFyGuAfyHvIwbMQTyFBflcaX4ep1X7U1XWzrNBlZdDRFBvPX3njMsXseA82 5SuLNApz9t7O+iG7nf5Yj0pEYiYYS7b52/1+RJq+as8hggvNY25s+56m6sHW7cPeghwF d7cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3vIKDhkdBHpJGsSr1ppRdTN17fdllSE311fHIekkoBE=; b=nCTsO1JZmaabdhYMbtjMLtbd5/3+GeEONQytfSxE843PBSf8MHwwLfqtVrtriUdJF7 Gg74WI39LUckBTdA4H3ZFk3NwsL+T8KCUNf51vySgDJmy9x5htVqAxx2XVfzt+Z3cUgB 3pp3eTckclIyn3NG90M/IiG1vC03DoAtfyhyTOaGsqVrYaTpxR8U+z4Fb0dRxSrrHJli EMFG1ivzMIWp7fJJesyFjo8CX+RRZYlr9b2EqUdDH/45vfUUT1brR/2pmu1wuv30vnDa JGOSUZbB74e7RnidCoXynv9kdVY5+UsyE2Bd5st87pb9mRefsLEIZWyiNv2t8+/+N+Lo ZnFg== X-Gm-Message-State: AOAM530Tjle2uICT/7fSrQyHPhE/DDcSQfrdzYYFKjpCC25y2He9zLWu mM+tf3JeLjZfq1m6Xj/FQ6dkap0CuomlQCBc X-Google-Smtp-Source: ABdhPJxGD7wqa2MQgmIqu3qQU/1a2M26v/8IQ4mbRmL0dbW9KX6jCXagGRk9/Muptsn+/M+ouktT2Q== X-Received: by 2002:a17:906:b53:: with SMTP id v19mr3059354ejg.250.1606402208421; Thu, 26 Nov 2020 06:50:08 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id cw26sm3249359ejb.47.2020.11.26.06.50.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 06:50:07 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Nov 2020 14:50:04 +0000 Message-Id: <20201126145005.8838-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201126145005.8838-1-david.plowman@raspberrypi.com> References: <20201126145005.8838-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 1/2] libcamera: controls: Add DigitalGain control 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This control reports the global digital gain applied by the pipeline as a whole, after capturing a raw image from the sensor. Signed-off-by: David Plowman Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/control_ids.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index c8874fa9..75a00f79 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -530,4 +530,21 @@ controls: This control is only present when the pipeline supports scaling. Its maximum valid value is given by the properties::ScalerCropMaximum property, and the two can be used to implement digital zoom. + + - DigitalGain: + type: float + description: | + Digital gain value applied during the processing steps applied + to the image as captured from the sensor. + + The global digital gain factor is applied to all the colour channels + of the RAW image. Different pipeline models are free to + specify how the global gain factor applies to each separate + channel. + + If an imaging pipeline applies digital gain in distinct + processing steps, this value indicates their total sum. + Pipelines are free to decide how to adjust each processing + step to respect the received gain factor and shall report + their total value in the request metadata. ... From patchwork Thu Nov 26 14:50:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10513 X-Patchwork-Delegate: laurent.pinchart@ideasonboard.com 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 022A2BE08A for ; Thu, 26 Nov 2020 14:50:13 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C696A63474; Thu, 26 Nov 2020 15:50:12 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="kOdPLI5O"; dkim-atps=neutral Received: from mail-ed1-x542.google.com (mail-ed1-x542.google.com [IPv6:2a00:1450:4864:20::542]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E05E863469 for ; Thu, 26 Nov 2020 15:50:09 +0100 (CET) Received: by mail-ed1-x542.google.com with SMTP id q3so2527360edr.12 for ; Thu, 26 Nov 2020 06:50:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=B0Fp/V/N1tYQw2TF4EfOmCRw4e3oIj27rbtr/hkcuD4=; b=kOdPLI5OAalplyuHA8+MXFzVZw0o4Y3q69KSP+hGLRx6I5BLQEb9/qOB3zPXeN/gGv aEkqRuGWRdDdCfDv/4c0wJt9gLig5kmY4FsjQpRLPvRoBQWVFqJi10f33A7Mbn/GmZlt ar+V3iZ9xO9v0TJGMH/8GV0RT6TaUZ3h/BI3ctZUozoLp33NmYiRrIQuZDkyvw8hnVEd nRamARczZroCLYXdu/dAQ5LHiWYtA2zMi4u3DmE7XtHojeMGaiSuDAAWVmSzYtszGOTn z4BlFJ6Q3foj0VBTeAIHTR+UupenyegX/hUMwyCvkZGoyLafEAMNL+JLYuqfyHoY5CQ/ RBSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B0Fp/V/N1tYQw2TF4EfOmCRw4e3oIj27rbtr/hkcuD4=; b=qEH+hM35dxuII1r0Tf8Cw+1faeYK/u6fa6BgEciNRVvfGtqHydBM5eYQJu6yrbM+OA ofn1Qbckprf0DakSp89/TBBR02dmJr0FItq79g0Jl+AyOUP+eJeH165Igzn/UbAVSY/Y 4iTan/W5aiSAe75A78kb8rI0hTxPh4g+0+3E1vDn3C+I0m+v8EkzWkZ5GBeKP4j9evRL RxLXC6ehX4ADj5iG3TsIEJ2KWlkaqYeEcwd+8u+Rjt9wpng7oRWmGtqSKK6T9FFiQ9Dc iZ8fgtx84abxbQ+RoqZzDpjU5OUskdAI/zLLmAR7B+euKVWrZa49j4DQGBzeKlKe+xvy s/hw== X-Gm-Message-State: AOAM531e8ulMlNDo6eO2PPQNBN2EdQ7QdG9gwedI90tLbX2ExVtus7D1 dzPNOqBwfL/t6b+6YeWh34qf/KclbICfKWTI X-Google-Smtp-Source: ABdhPJxuVrB9PTFmL2a5pwOB74GI6dc4sPAqhDlCRZ9OmM9CY8SRDbTzpvV/3z93g1YqgmDV7z7E2Q== X-Received: by 2002:aa7:d787:: with SMTP id s7mr2883029edq.205.1606402209387; Thu, 26 Nov 2020 06:50:09 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id cw26sm3249359ejb.47.2020.11.26.06.50.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 26 Nov 2020 06:50:08 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 26 Nov 2020 14:50:05 +0000 Message-Id: <20201126145005.8838-3-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201126145005.8838-1-david.plowman@raspberrypi.com> References: <20201126145005.8838-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/2] src: ipa: raspberrypi: Add digital gain to libcamera metadata 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The digital gain reported by the AGC algorithm is reported in the metadata that is included in completed requests. Signed-off-by: David Plowman Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/raspberrypi.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 9853a343..631fe7b3 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -403,8 +403,10 @@ void IPARPi::reportMetadata() } AgcStatus *agcStatus = rpiMetadata_.GetLocked("agc.status"); - if (agcStatus) + if (agcStatus) { libcameraMetadata_.set(controls::AeLocked, agcStatus->locked); + libcameraMetadata_.set(controls::DigitalGain, agcStatus->digital_gain); + } LuxStatus *luxStatus = rpiMetadata_.GetLocked("lux.status"); if (luxStatus)