From patchwork Wed Dec 2 11:52:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10542 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 8C5BCBE177 for ; Wed, 2 Dec 2020 11:53:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D2525634A2; 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="Ja/daMsS"; dkim-atps=neutral Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2D826635A2 for ; Wed, 2 Dec 2020 12:52:59 +0100 (CET) Received: by mail-wr1-x42a.google.com with SMTP id p8so3558234wrx.5 for ; Wed, 02 Dec 2020 03:52:59 -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=Hmm1WGdx4I+pN4Vv1vhTrXS7T6AbovSVEaKZpFzO8uc=; b=Ja/daMsSeYgdmdU5Be+e/S/848Hc+B3LhxFRD5m8EuOZJBnmAWL6YRlkluDzU99G7M s1SlX8ca2MFlnspptWvTiqHKYAcV6n17aiVyUS52dFKg/Xeo3eUtJzB1oAQhrpQoi+oT /FF9NevHcJkHzTTdMWfLf7EpEtpSWxtDCf91/pd+Kh7dO/5h2pvfZ6YOgMW/p8EmC7ye VcbiNvA+1U+8VHwOAg/6b7Ow1nIZDGGryajf4wEp0TupulxCdSbYIXSRBEurdqgPl/XF NB10jOk7dcFZs9wqzpvQUhyZC5XPcPsanvFDb3hOg8ZLxUXgtOPMVTWkxXmsV47XAN22 9T0g== 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=Hmm1WGdx4I+pN4Vv1vhTrXS7T6AbovSVEaKZpFzO8uc=; b=Cgh2PS1UaNIgmZD9NhClfZSDACtSfvQiQT80Dgpzye56Y2UjFSr0ZHjvBxLx4hSvD4 sVstBGHccy2uuG00GEz2X1QzftEDruFVxWfbLbIW0phQFcP69t9H3ke8QOEqY+TcABdt B6elufttqKKxA0E8XKepr/OKFDed0GfGud59FpRpA1w2BAScH7R17TN9vmp5ZdR8R+R3 BRfaT8k59Hdk1QEDgOKRP1wYIv2uWyP4vZgfSwsmZqcO6tBgyOvS/lAXFBt04sr9MUIE znh9G1WTcYgNOjyVzpdKpkua3EZ6jDc5uyKlp3TAVOAZTbgI+Ne+FkzwFZ+2lPx3nGqt 24ug== X-Gm-Message-State: AOAM531B+kGneylNcf3lDX8+K1Q2sYwq+CWRAWOA0HsIIwD9lmVKNCw2 lp8VdZu/BKgoX0d7W6N5oCxIaCPbTPwX0bku X-Google-Smtp-Source: ABdhPJzxv/nYP74jYUkmGJp9s48hl55AD5e6jGCyohgtnE+Mh1duFAJ9Zd0jcZ6GGYB3uD5qlF4BNw== X-Received: by 2002:adf:a3c1:: with SMTP id m1mr3184816wrb.28.1606909978639; Wed, 02 Dec 2020 03:52:58 -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.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 03:52:58 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Wed, 2 Dec 2020 11:52:49 +0000 Message-Id: <20201202115253.14705-2-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 1/5] src: ipa: raspberrypi: Distinguish the first camera start from others 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 makes it possible to tell whether we're starting the sensor for the first time, or whether it's happening because of a mode switch or because the camera has been paused and re-started. Depending on this, some sensors may require us to drop different numbers of frames. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/raspberrypi.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp index 69be5e4e..b8298768 100644 --- a/src/ipa/raspberrypi/raspberrypi.cpp +++ b/src/ipa/raspberrypi/raspberrypi.cpp @@ -67,7 +67,7 @@ public: IPARPi() : lastMode_({}), controller_(), controllerInit_(false), frameCount_(0), checkCount_(0), mistrustCount_(0), - lsTable_(nullptr) + lsTable_(nullptr), firstStart_(true) { } @@ -145,6 +145,9 @@ private: /* LS table allocation passed in from the pipeline handler. */ FileDescriptor lsTableHandle_; void *lsTable_; + + /* Distinguish the first camera start from others. */ + bool firstStart_; }; int IPARPi::init(const IPASettings &settings) @@ -179,6 +182,8 @@ int IPARPi::start(const IPAOperationData &ipaConfig, IPAOperationData *result) result->operation |= RPi::IPA_CONFIG_SENSOR; } + firstStart_ = false; + return 0; }