[{"id":25353,"web_url":"https://patchwork.libcamera.org/comment/25353/","msgid":"<Y0Cp+YxGJwOP70Do@pendragon.ideasonboard.com>","date":"2022-10-07T22:36:41","subject":"Re: [libcamera-devel] [PATCH v2 04/10] ipa: raspberrypi: Remove\n\tinitialized_ field from CamHelper","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Naush,\n\nThank you for the patch.\n\nOn Thu, Oct 06, 2022 at 02:17:38PM +0100, Naushir Patuck via libcamera-devel wrote:\n> Given that the single user of the CamHelper is the Raspberry Pi IPA, the\n> initialized_ field check is unnecessary. Remove the check and the field.\n> \n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/ipa/raspberrypi/cam_helper.cpp | 9 +--------\n>  src/ipa/raspberrypi/cam_helper.h   | 1 -\n>  2 files changed, 1 insertion(+), 9 deletions(-)\n> \n> diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\n> index fd3527b94501..45214531626e 100644\n> --- a/src/ipa/raspberrypi/cam_helper.cpp\n> +++ b/src/ipa/raspberrypi/cam_helper.cpp\n> @@ -7,7 +7,6 @@\n>  \n>  #include <linux/videodev2.h>\n>  \n> -#include <assert.h>\n>  #include <map>\n>  #include <string.h>\n>  \n> @@ -41,8 +40,7 @@ CamHelper *CamHelper::create(std::string const &camName)\n>  }\n>  \n>  CamHelper::CamHelper(std::unique_ptr<MdParser> parser, unsigned int frameIntegrationDiff)\n> -\t: parser_(std::move(parser)), initialized_(false),\n> -\t  frameIntegrationDiff_(frameIntegrationDiff)\n> +\t: parser_(std::move(parser)), frameIntegrationDiff_(frameIntegrationDiff)\n>  {\n>  }\n>  \n> @@ -63,13 +61,11 @@ void CamHelper::process([[maybe_unused]] StatisticsPtr &stats,\n>  \n>  uint32_t CamHelper::exposureLines(const Duration exposure, const Duration lineLength) const\n>  {\n> -\tassert(initialized_);\n>  \treturn exposure / lineLength;\n>  }\n>  \n>  Duration CamHelper::exposure(uint32_t exposureLines, const Duration lineLength) const\n>  {\n> -\tassert(initialized_);\n>  \treturn exposureLines * lineLength;\n>  }\n>  \n> @@ -80,8 +76,6 @@ uint32_t CamHelper::getVBlanking(Duration &exposure,\n>  \tuint32_t frameLengthMin, frameLengthMax, vblank;\n>  \tuint32_t exposureLines = CamHelper::exposureLines(exposure, mode_.minLineLength);\n>  \n> -\tassert(initialized_);\n> -\n>  \t/*\n>  \t * minFrameDuration and maxFrameDuration are clamped by the caller\n>  \t * based on the limits for the active sensor mode.\n> @@ -110,7 +104,6 @@ void CamHelper::setCameraMode(const CameraMode &mode)\n>  \t\tparser_->setBitsPerPixel(mode.bitdepth);\n>  \t\tparser_->setLineLengthBytes(0); /* We use SetBufferSize. */\n>  \t}\n> -\tinitialized_ = true;\n>  }\n>  \n>  void CamHelper::getDelays(int &exposureDelay, int &gainDelay,\n> diff --git a/src/ipa/raspberrypi/cam_helper.h b/src/ipa/raspberrypi/cam_helper.h\n> index 9b5e602689f3..6771829a56da 100644\n> --- a/src/ipa/raspberrypi/cam_helper.h\n> +++ b/src/ipa/raspberrypi/cam_helper.h\n> @@ -106,7 +106,6 @@ protected:\n>  \tCameraMode mode_;\n>  \n>  private:\n> -\tbool initialized_;\n>  \t/*\n>  \t * Smallest difference between the frame length and integration time,\n>  \t * in units of lines.","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C3312C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  7 Oct 2022 22:36:48 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2C52A62D2D;\n\tSat,  8 Oct 2022 00:36:48 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B4C1862CEC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  8 Oct 2022 00:36:46 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0E4BD4E6;\n\tSat,  8 Oct 2022 00:36:45 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1665182208;\n\tbh=L9ilusx45rEV6G+T0Wuz7Ulqt5WYlzicfXdU6Ur9Z/Q=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=ZoKJj9nyb2pEd/O06poDpSt9dSRIAYaz0f9dAQknvUYDYNmxbH/lougsshNFqHyOp\n\tuZwNOEwPJmA+NKeENompZ7gVDJfx8VAg24E8HN/3TSXhcw2CX10OVxMKo5avhUEa9Q\n\t4C5mB83AphZkJfuZIwgw2QjNfWC2d+jRmycUx+DlVjMNo7Nd6nY+wDlO+uDplYhBWk\n\t96Yl3IdG+VIH52eBSnQqnIGUhAe/H28z0ZY+qCn4PJg4cnsJnPXgEyeDMqt3cqAbjO\n\tjRBSQ/erJyFmjPO47EZIsnJkjFxaaMOI0sg4TkGoE55pj4AUcs783OCSBvgTu2EBp9\n\tKelWQqnyYkWEw==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1665182206;\n\tbh=L9ilusx45rEV6G+T0Wuz7Ulqt5WYlzicfXdU6Ur9Z/Q=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=SYaBEiuoKgo0Rmy0/j13oHwd6w9R4pBFcgZdqmDsrwYlgWSvyKv4fV9z4wJlxWQfQ\n\tvBRGVcUYWw9IILY40wu+OPisu0TL7rm3xOOtyQc2L/LqRlD68ugyqwGiD0unLEMi1r\n\t6yjgyf9+6lXFXWgyu3lL/GM11Z1s4Fv8h6sYGmME="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"SYaBEiuo\"; dkim-atps=neutral","Date":"Sat, 8 Oct 2022 01:36:41 +0300","To":"Naushir Patuck <naush@raspberrypi.com>","Message-ID":"<Y0Cp+YxGJwOP70Do@pendragon.ideasonboard.com>","References":"<20221006131744.5179-1-naush@raspberrypi.com>\n\t<20221006131744.5179-5-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20221006131744.5179-5-naush@raspberrypi.com>","Subject":"Re: [libcamera-devel] [PATCH v2 04/10] ipa: raspberrypi: Remove\n\tinitialized_ field from CamHelper","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]