[{"id":34423,"web_url":"https://patchwork.libcamera.org/comment/34423/","msgid":"<i3p2osbbcqq7jkxttajetxzlt5expzifnlgvghgzcxh23jnlnc@nlmhgo5sgw6t>","date":"2025-06-05T07:28:28","subject":"Re: [PATCH v2 5/6] pipeline: rpi: Remove ispOutputCount_ and\n\tispOutputTotal_","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Naush\n\nOn Thu, May 22, 2025 at 08:48:21AM +0100, Naushir Patuck wrote:\n> With the drop frame logic removed from the pipeline handler, these\n> member variables and not used, so remove them.\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nIndeed, these also seems to be unused\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n\n> ---\n>  src/libcamera/pipeline/rpi/common/pipeline_base.h |  6 +-----\n>  src/libcamera/pipeline/rpi/pisp/pisp.cpp          | 12 ------------\n>  src/libcamera/pipeline/rpi/vc4/vc4.cpp            | 15 ---------------\n>  3 files changed, 1 insertion(+), 32 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> index e27c4f860d1a..898f31577059 100644\n> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.h\n> @@ -48,8 +48,7 @@ class CameraData : public Camera::Private\n>  public:\n>  \tCameraData(PipelineHandler *pipe)\n>  \t\t: Camera::Private(pipe), state_(State::Stopped),\n> -\t\t  startupFrameCount_(0), invalidFrameCount_(0), buffersAllocated_(false),\n> -\t\t  ispOutputCount_(0), ispOutputTotal_(0)\n> +\t\t  startupFrameCount_(0), invalidFrameCount_(0), buffersAllocated_(false)\n>  \t{\n>  \t}\n>\n> @@ -179,9 +178,6 @@ protected:\n>\n>  \tvirtual void tryRunPipeline() = 0;\n>\n> -\tunsigned int ispOutputCount_;\n> -\tunsigned int ispOutputTotal_;\n> -\n>  private:\n>  \tvoid checkRequestCompleted();\n>  };\n> diff --git a/src/libcamera/pipeline/rpi/pisp/pisp.cpp b/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n> index 91e7f4c94d96..ccf135c3d8ce 100644\n> --- a/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n> +++ b/src/libcamera/pipeline/rpi/pisp/pisp.cpp\n> @@ -1834,12 +1834,6 @@ void PiSPCameraData::beOutputDequeue(FrameBuffer *buffer)\n>  \t\tdmabufSyncEnd(buffer->planes()[0].fd);\n>\n>  \thandleStreamBuffer(buffer, stream);\n> -\n> -\t/*\n> -\t * Increment the number of ISP outputs generated.\n> -\t * This is needed to track dropped frames.\n> -\t */\n> -\tispOutputCount_++;\n>  \thandleState();\n>  }\n>\n> @@ -1885,7 +1879,6 @@ void PiSPCameraData::prepareIspComplete(const ipa::RPi::BufferIds &buffers, bool\n>  \t\t * If there is no need to run the Backend, just signal that the\n>  \t\t * input buffer is completed and all Backend outputs are ready.\n>  \t\t */\n> -\t\tispOutputCount_ = ispOutputTotal_;\n>  \t\tbuffer = cfe_[Cfe::Output0].getBuffers().at(bayerId).buffer;\n>  \t\thandleStreamBuffer(buffer, &cfe_[Cfe::Output0]);\n>  \t} else\n> @@ -1994,7 +1987,6 @@ int PiSPCameraData::configureBe(const std::optional<ColorSpace> &yuvColorSpace)\n>  \tglobal.bayer_enables |= PISP_BE_BAYER_ENABLE_INPUT;\n>  \tglobal.bayer_order = toPiSPBayerOrder(cfeFormat.fourcc);\n>\n> -\tispOutputTotal_ = 1; /* Config buffer */\n>  \tif (PISP_IMAGE_FORMAT_COMPRESSED(inputFormat.format)) {\n>  \t\tpisp_decompress_config decompress;\n>  \t\tdecompress.offset = DefaultCompressionOffset;\n> @@ -2025,7 +2017,6 @@ int PiSPCameraData::configureBe(const std::optional<ColorSpace> &yuvColorSpace)\n>  \t\tsetupOutputClipping(ispFormat0, outputFormat0);\n>\n>  \t\tbe_->SetOutputFormat(0, outputFormat0);\n> -\t\tispOutputTotal_++;\n>  \t}\n>\n>  \tif (global.rgb_enables & PISP_BE_RGB_ENABLE_OUTPUT1) {\n> @@ -2049,7 +2040,6 @@ int PiSPCameraData::configureBe(const std::optional<ColorSpace> &yuvColorSpace)\n>  \t\tsetupOutputClipping(ispFormat1, outputFormat1);\n>\n>  \t\tbe_->SetOutputFormat(1, outputFormat1);\n> -\t\tispOutputTotal_++;\n>  \t}\n>\n>  \t/* Setup the TDN I/O blocks in case TDN gets turned on later. */\n> @@ -2256,8 +2246,6 @@ void PiSPCameraData::prepareCfe()\n>\n>  void PiSPCameraData::prepareBe(uint32_t bufferId, bool stitchSwapBuffers)\n>  {\n> -\tispOutputCount_ = 0;\n> -\n>  \tFrameBuffer *buffer = cfe_[Cfe::Output0].getBuffers().at(bufferId).buffer;\n>\n>  \tLOG(RPI, Debug) << \"Input re-queue to ISP, buffer id \" << bufferId\n> diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> index fe910bdf2ff9..ac6dab814d35 100644\n> --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp\n> @@ -597,8 +597,6 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi\n>  \t\tstream->setFlags(StreamFlag::External);\n>  \t}\n>\n> -\tispOutputTotal_ = outStreams.size();\n> -\n>  \t/*\n>  \t * If ISP::Output0 stream has not been configured by the application,\n>  \t * we must allow the hardware to generate an output so that the data\n> @@ -625,8 +623,6 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi\n>  \t\t\treturn -EINVAL;\n>  \t\t}\n>\n> -\t\tispOutputTotal_++;\n> -\n>  \t\tLOG(RPI, Debug) << \"Defaulting ISP Output0 format to \"\n>  \t\t\t\t<< format;\n>  \t}\n> @@ -662,8 +658,6 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi\n>  \t\t\t\t\t<< ret;\n>  \t\t\treturn -EINVAL;\n>  \t\t}\n> -\n> -\t\tispOutputTotal_++;\n>  \t}\n>\n>  \t/* ISP statistics output format. */\n> @@ -676,8 +670,6 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi\n>  \t\treturn ret;\n>  \t}\n>\n> -\tispOutputTotal_++;\n> -\n>  \t/*\n>  \t * Configure the Unicam embedded data output format only if the sensor\n>  \t * supports it.\n> @@ -843,12 +835,6 @@ void Vc4CameraData::ispOutputDequeue(FrameBuffer *buffer)\n>  \t\thandleStreamBuffer(buffer, stream);\n>  \t}\n>\n> -\t/*\n> -\t * Increment the number of ISP outputs generated.\n> -\t * This is needed to track dropped frames.\n> -\t */\n> -\tispOutputCount_++;\n> -\n>  \thandleState();\n>  }\n>\n> @@ -880,7 +866,6 @@ void Vc4CameraData::prepareIspComplete(const ipa::RPi::BufferIds &buffers,\n>  \t\t\t<< \", timestamp: \" << buffer->metadata().timestamp;\n>\n>  \tisp_[Isp::Input].queueBuffer(buffer);\n> -\tispOutputCount_ = 0;\n>\n>  \tif (sensorMetadata_ && embeddedId) {\n>  \t\tbuffer = unicam_[Unicam::Embedded].getBuffers().at(embeddedId & RPi::MaskID).buffer;\n> --\n> 2.43.0\n>","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 F28B5C3237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  5 Jun 2025 07:28:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B560268DBD;\n\tThu,  5 Jun 2025 09:28:34 +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 1DCD768DB2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  5 Jun 2025 09:28:32 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 6D8C26AF;\n\tThu,  5 Jun 2025 09:28:28 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"QS+J4kwQ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1749108508;\n\tbh=0/IijUeKdG/4wMw3XNoZ0+7oe7n5Apcbt102FE9si0Q=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=QS+J4kwQHOCl5HFLOLy2vjbZYgdHGEzXqGEohaOVUG8j46hhEvxGobJU0oGePOJaA\n\tvCdXj8KkFbFEwc1dRHXQhbDSXqcHSmEdDWoObGWcBG8Y1VDZJX0/JQRIml0RxIWsBY\n\t8baWGJzK/YhcuNloxsmjUnGYnDjFAz08TJ3azdD4=","Date":"Thu, 5 Jun 2025 09:28:28 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org, \n\tDavid Plowman <david.plowman@raspberrypi.com>","Subject":"Re: [PATCH v2 5/6] pipeline: rpi: Remove ispOutputCount_ and\n\tispOutputTotal_","Message-ID":"<i3p2osbbcqq7jkxttajetxzlt5expzifnlgvghgzcxh23jnlnc@nlmhgo5sgw6t>","References":"<20250522075244.1198110-1-naush@raspberrypi.com>\n\t<20250522075244.1198110-6-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20250522075244.1198110-6-naush@raspberrypi.com>","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]