From patchwork Wed Dec 2 11:52:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10541 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 E982CBE177 for ; Wed, 2 Dec 2020 11:53:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 57783635A6; Wed, 2 Dec 2020 12:53:00 +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="V8fKOzQj"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8D475634A2 for ; Wed, 2 Dec 2020 12:52:58 +0100 (CET) Received: by mail-wr1-x431.google.com with SMTP id 23so3516099wrc.8 for ; Wed, 02 Dec 2020 03:52:58 -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=tEl0E2c2Nf7l7NPS4kjks3h3Zp0cl4Xk9OqQFeTEQ7E=; b=V8fKOzQjDfErC2N2P1BotPFjcQfrFtuP4wXl8fUp5E5fMlHryKhk6QPv15VWFPCi+z 8THAGPX4Tkt8AWgI+ytSmgu8HjQvQ+Os3tJpt6g5isSqSZScjZs36SUYOtaxZC1gpwUS o4Vp0ZtoIzfkyrwUPDN+03YcR2v21zTTadEw+SsVg2MuTbT+Uma5QuDFMTd57UK7ZU+R XWAblIeh5sk9iijD/u8Kywnq3CZ5noYskAaDR0vJ1R3HnDyDqEo54C/XS3HEJkE6ewBn lU/hP0qKDpHmWWHlXUtcmEWxUdDI9edJqL18vxpnzhB4nLk+fyWoZbOJ3wk8OF27V763 DnWg== 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=tEl0E2c2Nf7l7NPS4kjks3h3Zp0cl4Xk9OqQFeTEQ7E=; b=cWRnVx2fpFxqnDyNLyWpuqzfU+WqgYMAB79qer6erIkaOvp03aC6G0kqoku6gF82IO H23rSRzMAoXt1OpJbAHdsujt/Fuwi3KGJfUaShguMyb5h9Ycjp4yXHbC3zvSXTYY8RW5 U9qv/bzcFlIkUepj0Qop0AzDXmQfeK8jj+fE0manir9/2AFZIoYDwnNCeNKC+kJvlQce 1pfrt+eAUUIbSYJdSi/8s+lkQjO4vytEj5XUBKV+CoMCo0V47OwouQva/+IoewY8YG9Y /MtyWDONLNVlXKAWMVik4GSzJSCtRCeNZNRQmPGb0FBcqENe/pkX+IAiqnROOS6PxtbD +6oA== X-Gm-Message-State: AOAM530LL/ACW5VWF0WYuN/ihf5zjo2cWU09Sw/qw6+ieLJAhv+4eQR+ V/0YGksy/75GLm0HCJK6/KiOFxEmK22SLADG X-Google-Smtp-Source: ABdhPJxa7SD02rHsQYV4COJM1/bpz7L0hFMAWKDgiYNRfYVgbq75BiznteddZXzMIpANgqezKBVBhw== X-Received: by 2002:adf:f00f:: with SMTP id j15mr3021238wro.102.1606909977836; Wed, 02 Dec 2020 03:52:57 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id n189sm1739215wmf.20.2020.12.02.03.52.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 03:52:57 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Wed, 2 Dec 2020 11:52:48 +0000 Message-Id: <20201202115253.14705-1-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 0/5] Raspberry Pi AGC: initial frame drop count 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 for merging my last set of AGC related patches. Here's the final set of AGC patches that I have prior to the release of our libcamera apps, I'm hoping we can get a bit of a head start with them! The patches are all quite bitesize, and are concerned with deciding how many frames our pipeline handler should drop when the camera starts up for the first time (while the AGC converges from cold). Responsibility has been moved from the CamHelper class, where it was entirely inappropriate really, to the AGC itself. One of the patches is dependent on Naush's Camera::start patch set so maybe we look slightly askance at that one for now! So we have: 1. Add a flag to the pipeline handler so we know if it's the first time we're starting the camera. 2. (This one depends on Naush's patch set) The number of frames to drop is now returned by the IPA to the Camera::start method, not Camera::configure. 3. The AGC algorithm acquires a GetDropFrames method which can be called before the camera starts to discover the number of frames the AGC wants us to drop. 4. The code in IPARPi::start is amended to use the new Agc::GetDropFrames method. 5. CamHelperOv5647 needs to request that we skip 2 frames at startup. (It is inheriting the default value of zero otherwise, which is not correct for this sensor.) Thanks very much! Best regards David David Plowman (5): src: ipa: raspberrypi: Distinguish the first camera start from others src: raspberrypi: Pass the drop frame count in start, not configure src: ipa: raspberrypi: agc: Add GetDropFrames method to AGC base class src: ipa: raspberrypi: Move initial frame drop decision to AGC src: ipa: raspberrypi: Drop the correct number of frames on startup for ov5647 src/ipa/raspberrypi/cam_helper.cpp | 6 +-- src/ipa/raspberrypi/cam_helper_ov5647.cpp | 10 ++++ .../raspberrypi/controller/agc_algorithm.hpp | 1 + src/ipa/raspberrypi/controller/rpi/agc.cpp | 11 ++++ src/ipa/raspberrypi/controller/rpi/agc.hpp | 2 + src/ipa/raspberrypi/raspberrypi.cpp | 53 ++++++++++++------- .../pipeline/raspberrypi/raspberrypi.cpp | 25 ++++----- 7 files changed, 73 insertions(+), 35 deletions(-)