From patchwork Wed Dec 2 11:52:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10546 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 69837BE177 for ; Wed, 2 Dec 2020 11:53:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 374A2635AB; Wed, 2 Dec 2020 12:53:05 +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="gG2P9mer"; dkim-atps=neutral Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0C8DC635AB for ; Wed, 2 Dec 2020 12:53:03 +0100 (CET) Received: by mail-wm1-x342.google.com with SMTP id v14so6444035wml.1 for ; Wed, 02 Dec 2020 03:53:03 -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=kS/s/B8ia6i0CSyDvuDHlL2Gy/xkSTrmSZjKbtjVXbg=; b=gG2P9merZaUHHaorMfRGiLiKXNAzctRxKqwkpC5NQmGo1ZtVVxGnAnJ1nyRtoZUpDz 0LdlDf2Qhh/daq7K8cfruJEwX6HaqTFTOSRtmisA7NkwPzcD47Vc/RXQczt+2x0SCJHD 8yjhgTb57t6AEY4YOhIJU+TPMeCLW6B9h40lSr5RnZxQs4uXJAvMdiEaf3NWKxKSIqfF DwU4C/0+4HlOOHHIxqicOjhla9WjwihhwaL1+lqI6sASIG9Q/ozIxLJDpTJedllpX3Nc sSSi+JWhhuX/ApM/Q2VlKM6cRRaQ/Ht8pWU3bp9luHXWIYBI1sZorLhSVLM+oxMXoK87 DhKw== 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=kS/s/B8ia6i0CSyDvuDHlL2Gy/xkSTrmSZjKbtjVXbg=; b=sivqxDFqwy7PUxBpbwyvwX2DRotV+LwDFiSHiNFNHuOjer/Wpc8KS02Nd3rQwpMF7L O4T/bIwQIvOMU66vPMCNJ8okFq3At9KdY8dgtZ33j9ngnK2qTVpNUj7NQH3DMst0K/Yr Ty5LwSg6M0KXNpQexIxLEu7rr6po8Sx4AufvXWMJVHc6MI+fIAH7sKSvWMykVp6uvFEL W/phaT5h5Knm0QCMs/ocySp8TpGcrjQxbigr60thk/yXdXmBuRV/Z0vasBVACZkx38j5 fJQe4WEwlVdTT3usn19Qv/iQTA4HIuh4wSOHHtgFT1MUBWzAWiOvh2kmfMBTzeAZO05i V9DA== X-Gm-Message-State: AOAM530Na7LpfOYNj2mUyQOeyOsc1vdLiGzrXV8uUhDuxW/6OSL1j7v+ +5bD6AcOiAkRUnIzFJUHT2ZlWaHuqD9gF0ET X-Google-Smtp-Source: ABdhPJzEcROacJ/pNddkUw4e6zMh+ntUCPWBz9VMZPU6U3hCf7KHMJlCx2mnYNEYEbOkXrPGQkiV/g== X-Received: by 2002:a05:600c:22d9:: with SMTP id 25mr2735364wmg.158.1606909982531; Wed, 02 Dec 2020 03:53:02 -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.53.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 03:53:01 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Wed, 2 Dec 2020 11:52:53 +0000 Message-Id: <20201202115253.14705-6-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201202115253.14705-1-david.plowman@raspberrypi.com> References: <20201202115253.14705-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 5/5] src: ipa: raspberrypi: Drop the correct number of frames on startup for ov5647 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 ov5647 delivers two under-exposed frames at startup, even when the exposure and gain are explicitly programmed. The system needs to be told to drop these. Signed-off-by: David Plowman --- src/ipa/raspberrypi/cam_helper_ov5647.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ipa/raspberrypi/cam_helper_ov5647.cpp b/src/ipa/raspberrypi/cam_helper_ov5647.cpp index dc5d8275..0b841cd1 100644 --- a/src/ipa/raspberrypi/cam_helper_ov5647.cpp +++ b/src/ipa/raspberrypi/cam_helper_ov5647.cpp @@ -19,6 +19,7 @@ public: uint32_t GainCode(double gain) const override; double Gain(uint32_t gain_code) const override; void GetDelays(int &exposure_delay, int &gain_delay) const override; + unsigned int HideFramesStartup() const override; unsigned int HideFramesModeSwitch() const override; unsigned int MistrustFramesStartup() const override; unsigned int MistrustFramesModeSwitch() const override; @@ -54,6 +55,15 @@ void CamHelperOv5647::GetDelays(int &exposure_delay, int &gain_delay) const gain_delay = 2; } +unsigned int CamHelperOv5647::HideFramesStartup() const +{ + /* + * On startup, we get a couple of under-exposed frames which + * we don't want shown. + */ + return 2; +} + unsigned int CamHelperOv5647::HideFramesModeSwitch() const { /*