From patchwork Thu Jan 21 11:58:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 10922 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 49DA6C0F2A for ; Thu, 21 Jan 2021 11:58:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CFA26681E5; Thu, 21 Jan 2021 12:58:55 +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="FqcaL8I/"; dkim-atps=neutral Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 236C868193 for ; Thu, 21 Jan 2021 12:58:54 +0100 (CET) Received: by mail-wr1-x429.google.com with SMTP id b5so1445069wrr.10 for ; Thu, 21 Jan 2021 03:58:54 -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=iMeO0jsi8Q9BIZe3db/m0dYlPNHtvZyBa7aNCKNjd70=; b=FqcaL8I/DzE2rEmGSzSU1UOK9PXtmThWg8fd3InrLpz80+VPZMqHGj8KZ/0EfrOdmo SoMZVlPDGzQ27N1oYQOud2nGJ/QXgh7PVydb7ksPQeaLuCU470Pdq3WVaMk+M7Nc2Ppw a2XGVNNdqsUmcwKXVeGhY8LCxHQRF7V8U92zb4PlprVoaNOoktkxFOhPGey4BlES4vWm WnAZg495ssDNPBdzQKhGrjh/ZqQta32sKTeFvb0pWBHs/J/ww5Eg53kmR7Rgm1dtOZx5 G/RhQKPHYrk7MRhACmwqvN+BI16rSqF7MRKJh9IAQGYfXcKVFCJD0JRN0jSewdL0WiWB qJ3Q== 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=iMeO0jsi8Q9BIZe3db/m0dYlPNHtvZyBa7aNCKNjd70=; b=IdEX1TwvnDy1zlHK370LPso3sKpX6X+fkghpWcNMLrcOzoeCaQs84HAjfASOxEXvKd ifZDRtymmale2w3fCElcDblEfEAkDXkKCHzjmmANiUZ+QgEtNyOjIBpP1wqS1LJx3qFk UD+RVXs8f2o5vJyVbyV+jm2zftuzRKxmpKrogYq9GRl5tycYLyPG1c6glQrUFuhR+Mp6 acEKyn4BcYytJtZMMdlrO/ZihG6iUq0go5uSm5yi+cyyaDVGXYTLrq5TUurl6GapOXUj 76QULgJ6utcbqbEKiCPOVucgB687LmExlq705Awc5uB7yw51Vtw5ynZGiHW/HGorzOWf 1Iiw== X-Gm-Message-State: AOAM533QJfKRznHUowoMnftXwTrit1Qn2TAOCEljPLQkxVm7+C7qqbhM piMO4QUGuySx8zWNHsMvTkorePC0oHvUXg== X-Google-Smtp-Source: ABdhPJw7ajAUSdqmARvu+3GzFMuKCg3HaMiamlQPWspNe933HCQfyHvRR6N5Q2Tiv58NFk5p+MmTlw== X-Received: by 2002:adf:fdcc:: with SMTP id i12mr13719805wrs.317.1611230333474; Thu, 21 Jan 2021 03:58:53 -0800 (PST) Received: from naushir-VirtualBox.patuck.local ([88.97.76.4]) by smtp.gmail.com with ESMTPSA id h13sm8044930wrm.28.2021.01.21.03.58.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 03:58:52 -0800 (PST) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Date: Thu, 21 Jan 2021 11:58:45 +0000 Message-Id: <20210121115849.682130-1-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/4] Raspberrypi: FrameDurations control refinements 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, I'm sure you all have had enough fatigue with frame rate patches from me, so just to make your day even better, here are some more :-) This set of patches address feedback points raised for the previous patch set. As discussed, these changes have been in my back pocket for a while, I just wanted to wait for the previous series to be merged before introducing them. Some further details: Patch 1/4 fixes a small issue where we get a warning log point when the control values get initialised. Patch 2/4 clamps application provided frame duration with what the sensor mode can support. It also addresses the \todo to return out the clamped values in metadata. Patch 3/4 links the maximum frame duration with AGC. The AGC now knows what the maximum allowable shutter speed is, so it can do the relevant calculations more optimally. Patch 4/4 might need a bit more context. It works around the problem of setting VBLANK and EXPOSURE through V4L2 at the same time. Of course, StaggeredCtrl is going to be deprecated, but it does provide an idea of what to do in DelayedCtrl to fix the problem. Depending on how things go, DelayedCtrl may be merged before this. In this case, patch 4/4 does not need merging, and the functionality in this change should eventually be ported across. Either way, there is no hard restriction on DelayedCtrl to have this in place straight away, as the Raspberry Pi will just about cope without it to start with - you may notice ever so slight AGC oscillations if you look for them. As always, any and all feedback is appreciated. Many thanks, Naush Naushir Patuck (4): raspberrypi: Add the correct integer const postfix for FrameDurations ipa: raspberrypi: Limit the calculated vblank based on the sensor mode ipa: raspberrypi: Pass the maximum allowable shutter speed into the AGC pipeline: raspberrypi: Add notion of immediate write to StaggeredCtrl include/libcamera/ipa/raspberrypi.h | 2 +- src/ipa/raspberrypi/cam_helper.cpp | 16 ++--- src/ipa/raspberrypi/cam_helper.hpp | 5 +- src/ipa/raspberrypi/cam_helper_imx219.cpp | 6 +- src/ipa/raspberrypi/cam_helper_imx477.cpp | 4 +- src/ipa/raspberrypi/cam_helper_ov5647.cpp | 4 +- .../raspberrypi/controller/agc_algorithm.hpp | 1 + src/ipa/raspberrypi/controller/camera_mode.h | 2 + src/ipa/raspberrypi/controller/rpi/agc.cpp | 49 +++++++++---- src/ipa/raspberrypi/controller/rpi/agc.hpp | 2 + src/ipa/raspberrypi/raspberrypi.cpp | 68 ++++++++++++++----- .../pipeline/raspberrypi/raspberrypi.cpp | 11 ++- .../pipeline/raspberrypi/staggered_ctrl.cpp | 39 ++++++++--- .../pipeline/raspberrypi/staggered_ctrl.h | 3 +- 14 files changed, 142 insertions(+), 70 deletions(-)