From patchwork Wed Nov 25 11:36:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10494 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 15828BE08A for ; Wed, 25 Nov 2020 11:36:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9C2BF6340B; Wed, 25 Nov 2020 12:36:45 +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="I7QR2hMt"; dkim-atps=neutral Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 15593633E5 for ; Wed, 25 Nov 2020 12:36:44 +0100 (CET) Received: by mail-wm1-x32d.google.com with SMTP id c198so1724771wmd.0 for ; Wed, 25 Nov 2020 03:36:44 -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:mime-version :content-transfer-encoding; bh=eAq61bDKq2Q2r9NvGmXj67CXN/Yz2XN5ex9tN8GiTyk=; b=I7QR2hMtzmZV0FypR3DL/faE0ZcRhgBcAejVbdcsLm3kruyK08+saD8JsI2CgdTvbc HnwTrBSDHH82W4rSAKkLqlaxk54ufgWeLU3Ctgzq5ajE4yjJMMxRobsjk0JNp8ukJObr Vd+v9GRRM6kWRJjq5t6ST2OuB1u1N1LnJMcSVatjG1TyaXGdhxp2O1LYIwCODMsT9vnm PVfysaxMv0R3jutlPS9m4qfl45lkHhiBVej6aM+bkyRH5vpvofdjVtVWoA8/bANi/+ER v2HIOOURehkRaiqAQvYNNDFisIdEBtpOQ6bcMVMGIRETToQoMQ36QRaSYxUM0Bw+gGkA DNBA== 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:mime-version :content-transfer-encoding; bh=eAq61bDKq2Q2r9NvGmXj67CXN/Yz2XN5ex9tN8GiTyk=; b=k2NOHqsbfGILBe49VYBsaK0FPTHRg9HP0XLRh2GmVp3fzaBhSAPL1ZGNu33V4bQHBm n0M8m3c6vNb0zrrmlwMNLsDbdfFaRiKPVm5mF2QT3Kf9XinKuJXs7doIjym7ZYrvdWtt iHYhhu2no630ouDsHVn2dOVhyOlzIu+BEqDySdv/1xtcXeqPzT7aGFUIZXK2+cnWaeiJ WVgnoS9l2DZOBJwNfObvQJVMaAFCbd7tY7Hs+5HIRW9qwfljkI66Out/zkxMWLOhj7FG 6uRfjsZraZuJwYPmdTnjcI21c9U8/pv0Rc0mkPFOS1aftIyxYX/+QbPPjU399qxHtuZ1 rBFA== X-Gm-Message-State: AOAM5311vE6Ubo8Rr2xxVmIQblv6vISGif28wrWJjlJ3TW/1O1eOjNws AiYLzzHF9tLKjWKaHopJw/UF2xBQj9WM62zH X-Google-Smtp-Source: ABdhPJw3OIIzch4dqI5xB0iIVPmSjnHZ69uzYNRLwtJvmrLXi7Tg8gyutZHK5dm0TbZv6khyT4twZw== X-Received: by 2002:a1c:e305:: with SMTP id a5mr3400391wmh.45.1606304203317; Wed, 25 Nov 2020 03:36:43 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id b14sm4232371wrq.47.2020.11.25.03.36.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Nov 2020 03:36:42 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Wed, 25 Nov 2020 11:36:37 +0000 Message-Id: <20201125113640.20246-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/3] Raspberry Pi AGC improvements 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" Hi everyone Thanks to Kieran for merging my previous AGC patches. I think I mentioned then that there would still be a few more to come - though nothing of great complexity - so here's the first few. I think only the second of these patches rises above the level of "fairly trivial", so it would certainly be good for Naush to review that one! We have: 1. When setting explicit shutter and gain values, the AGC would adapt slowly towards them. I think users would expect it to "jump" there immediately. 2. This patch stops us ever turning the AGC off even when it's disabled. Instead we put it into "fixed shutter and gain" mode, using the last values we saw. This is better because, if you then set the gain (for example), the shutter won't start "floating" again (which was the previous behaviour and, I think, unexpected for users). 3. Fixes some AGC oscillation problems (particularly at startup) with the imx219, caused by the fact that the sensor metadata isn't working for us. This means things can be unstable if we request exposures or gains that the sensor can't deliver (we have the same situation with the ov5647). Subsequent to these I do have a couple more AGC changes ready to go, mostly related to figuring out the correct number of frames to drop when the camera starts. However, these are dependent on Naush's Camera::start() patch set (or some equivalent variation thereof), so might I give that one a little nudge in passing please? Thanks and best regards David David Plowman (3): src: ipa: raspberrypi: Avoid AGC filtering when both gain and shutter specified src: ipa: raspberrypi: Improve behaviour when AE disabled src: ipa: raspberrypi: Fix initial AGC oscillation for imx219 sensor src/ipa/raspberrypi/controller/rpi/agc.cpp | 7 +++- src/ipa/raspberrypi/data/imx219.json | 4 +- src/ipa/raspberrypi/raspberrypi.cpp | 48 ++++++++++++++-------- 3 files changed, 38 insertions(+), 21 deletions(-)