From patchwork Thu Oct 6 13:17:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17545 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 C3A92BD16B for ; Thu, 6 Oct 2022 13:18:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8423162D0F; Thu, 6 Oct 2022 15:18:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1665062280; bh=9uSlBADtPmusFJSy/vPdN6s/sj96SrHKwSF9ge2O8co=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=NQ5Zxb0sK7mzVy3PNzU9JXGX+DaGSPzNStIXBOQSiYWuE8ENf1oCRLPFn+Vi8Qw+O GHk7DglZWJqKE7XDkqeKnskI89ZKGVXgNN/PjvsuOr2MeeUODFYVkM90/I+N6m3uFs E1IdUgcMefNDzcPjcwIwylLmtmk/sXnryiaDwvoSyR2RY10hFkyo+sMe9mvIlcu+cQ UQQfW9L5nF00DCp2MrcJGHMcgImk5k+esiYSjXpehqJw013fqEv5onTC4pWE10wum4 O9g/PSB8sYUgQiMSFhiNYDJp3MHhn6Fngm1nIjFRm+nj8KPgNbg1fHoVFzhc20q8JQ DFbuaheJ1r/RQ== Received: from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com [IPv6:2a00:1450:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E13762CF1 for ; Thu, 6 Oct 2022 15:17:57 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="I7y4TiKt"; dkim-atps=neutral Received: by mail-wr1-x42e.google.com with SMTP id a3so2732506wrt.0 for ; Thu, 06 Oct 2022 06:17:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=+XBEmVpKujqmMA3AqvvSLE7pPeInV6i9gV1hkCZ8g6I=; b=I7y4TiKtk8ZX88umR8aYHoOF36OLjwP7+wPnn5k63FKfRRAv6PATulAKEm4dTgVmM4 FaFqbq9ran1s0jaQLow4TOi2uW5d9RYwGCJJRqe2yMwRNnVIq/Wr5Xkrx1Q4JXRgpE5m StLE3PUpSZlgXEArD8hjTUeBOUL1VBbalEnjucJi5VgQwWfn74KfB0Ym9rEqPeNAHU5v x1pJSknVhL9s5jtQn5099gPVgiadswVliTTq/2Eacoq4EE7+8QJV+TvfTNeyt8LTWgHC Tyb+kSTwOOJvK2YjsmSWgwlhFa1I7912rL5MEdVljq2sCDPsek1HBtpNr16u/5fuFPWe zaiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=+XBEmVpKujqmMA3AqvvSLE7pPeInV6i9gV1hkCZ8g6I=; b=JJnYXOU6lsbou/mWZB9B2KMUzN7LSw10op/Dku1TTfJlwrcgyhT4VLIrnlyEYcM0Qz 9g0HYMsf6utmHg0Sb5/L+gir4dsnPot7t+p7YrBCSytqgVx5nvgUBtwCc5jMi8QLeUEm AScPYaRNvV2PpSuihSK6w+OggN24M/78HLq1MlyZr+x2Tn+nKVLeO+Jsbj/RyH1pZCQX KY9tgunbFZlitzZE5A5pLND+aqGMvs5GrcyUDR1iYDsiqo8qBPeELZBNq1GsY8HNTGQa TaX0bJyigCCZBBIHcn0OIo70InITKgAvSiolJejxa8dBE2N08l1hbIfbSUAbAYAzl4Oh G0yA== X-Gm-Message-State: ACrzQf0KTIlGpwdFvBf9+JlvWUiPdJ7qx8aGPdq1q4eFVx2uqpMm8uit EO9EoOA1VL+npgr8JnSH4/2txRjMPEIRNg== X-Google-Smtp-Source: AMsMyM5F04OaSMiEvjdTtxxjLXCkaqnGIR9EoG6QR6XS8jl8dYZVYlGl9SRFkaUwI/Kfs7eiJenKyQ== X-Received: by 2002:adf:b646:0:b0:221:76eb:b3ba with SMTP id i6-20020adfb646000000b0022176ebb3bamr3082713wre.237.1665062276505; Thu, 06 Oct 2022 06:17:56 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id q18-20020a056000137200b0022cc7c32309sm17986049wrz.115.2022.10.06.06.17.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 06:17:55 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 6 Oct 2022 14:17:38 +0100 Message-Id: <20221006131744.5179-5-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221006131744.5179-1-naush@raspberrypi.com> References: <20221006131744.5179-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 04/10] ipa: raspberrypi: Remove initialized_ field from CamHelper 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: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Given that the single user of the CamHelper is the Raspberry Pi IPA, the initialized_ field check is unnecessary. Remove the check and the field. Signed-off-by: Naushir Patuck Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/cam_helper.cpp | 9 +-------- src/ipa/raspberrypi/cam_helper.h | 1 - 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp index fd3527b94501..45214531626e 100644 --- a/src/ipa/raspberrypi/cam_helper.cpp +++ b/src/ipa/raspberrypi/cam_helper.cpp @@ -7,7 +7,6 @@ #include -#include #include #include @@ -41,8 +40,7 @@ CamHelper *CamHelper::create(std::string const &camName) } CamHelper::CamHelper(std::unique_ptr parser, unsigned int frameIntegrationDiff) - : parser_(std::move(parser)), initialized_(false), - frameIntegrationDiff_(frameIntegrationDiff) + : parser_(std::move(parser)), frameIntegrationDiff_(frameIntegrationDiff) { } @@ -63,13 +61,11 @@ void CamHelper::process([[maybe_unused]] StatisticsPtr &stats, uint32_t CamHelper::exposureLines(const Duration exposure, const Duration lineLength) const { - assert(initialized_); return exposure / lineLength; } Duration CamHelper::exposure(uint32_t exposureLines, const Duration lineLength) const { - assert(initialized_); return exposureLines * lineLength; } @@ -80,8 +76,6 @@ uint32_t CamHelper::getVBlanking(Duration &exposure, uint32_t frameLengthMin, frameLengthMax, vblank; uint32_t exposureLines = CamHelper::exposureLines(exposure, mode_.minLineLength); - assert(initialized_); - /* * minFrameDuration and maxFrameDuration are clamped by the caller * based on the limits for the active sensor mode. @@ -110,7 +104,6 @@ void CamHelper::setCameraMode(const CameraMode &mode) parser_->setBitsPerPixel(mode.bitdepth); parser_->setLineLengthBytes(0); /* We use SetBufferSize. */ } - initialized_ = true; } void CamHelper::getDelays(int &exposureDelay, int &gainDelay, diff --git a/src/ipa/raspberrypi/cam_helper.h b/src/ipa/raspberrypi/cam_helper.h index 9b5e602689f3..6771829a56da 100644 --- a/src/ipa/raspberrypi/cam_helper.h +++ b/src/ipa/raspberrypi/cam_helper.h @@ -106,7 +106,6 @@ protected: CameraMode mode_; private: - bool initialized_; /* * Smallest difference between the frame length and integration time, * in units of lines.