From patchwork Fri Jun 6 10:55:23 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 23479 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 D07EFC3324 for ; Fri, 6 Jun 2025 10:57:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CA89A68DC6; Fri, 6 Jun 2025 12:57:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="ad2U3I9z"; dkim-atps=neutral Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8DC3668DBE for ; Fri, 6 Jun 2025 12:57:00 +0200 (CEST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-450ddb35583so1798975e9.1 for ; Fri, 06 Jun 2025 03:57:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1749207420; x=1749812220; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UjhoSFLjQT8XeMDrUTrn+s1ViaVwS7kMkgdRcH6/WUg=; b=ad2U3I9zpLAhCS17UruZrqXLptJUe8aFCQf4/ZjuAtCMf/8PQbBf307kWIyDiVpFtj +OiHq0qM/LgYlE9zRZs8RlRooyzifeegDHwZL/t6qzYk3n8DWI1XmccVpRhqxWc4LkGp wdK+Rra3A1AKuRvFN1+9OnjR/9usoIpO3lthh1O/lMaWqsmGj51mQQEhsCZMN2iL1cxV V4zsGV9qwyGdDJ6SQEYJKZqwPphY1G5aF8/H5KfSWqbz1299uHIwZDMX4G8tPFObq9mH Txa0y6qp9kaX85royTt/1PqIVNOPWSDPaP8ORpFGw4PWdk0CtOqsAFdaCxzz57gKWKS5 alVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1749207420; x=1749812220; 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:message-id:reply-to; bh=UjhoSFLjQT8XeMDrUTrn+s1ViaVwS7kMkgdRcH6/WUg=; b=nK4ba1uUap2yDjb5IsdlLgSkQKJSpaaaWAxpgljbU3ujdOnGRzc6RhYFkBLPaOADb/ vAs6w9PodbqPtfCPhZo4zg3gO0XpebPW/jrWrQ5xrBI5tQ4U/PzHJpmMpd4vTxmrmTBA ozupxd+6et6hxHDArbQrNUfbcHUzhWwScuRj2NaR15wQi93QBHrquKMSKfKiLWNo12l0 eI+QEIFNfzN8+rnlwfwrC8eO18xBXWu5eVYUcg7sVbLyM6GVD936wewAL0I2/RDhqaZn GAqsqZAf7/5AHXqQWcxsrYtNM2L/5SSuZsBOmpA6FtQbTwkrjekRM3f87d9q7bbf2VnE syMQ== X-Gm-Message-State: AOJu0Yyh5VVtBLDChPX9D3z560SZrWVvXzMSGrvacV8dVnLKmZb3Mv0z Zy2XIhQCTZ9fWRqVsufiLSxrMTxYHe+73wTTkmz0cT01mhOYZHmoLzETzHEJ39+iiwVtYqMYy0d 0dM9Y X-Gm-Gg: ASbGncsAWZPf//Qxhzpm73dZpzdoZBICORFM5/7Y82ST9uELsjjWVcTc1ukYHZVQbgG NzJd7dFbKGxNsIJMM6T5GimD7JE9Kj7tBZZvLfE1ic0t/IsLaGjfaoYvpG81+7dCYTTnq7ad5t+ LJBtMnB1m0XbXpUPA72OS142VpD7bQdRglRHtTT8SMUcmwxUxF8aCCJE+bgVb4WPEkdn4tPO1as HuHwBp52XzFSdWPSuL7Xu2MSmoC7t3GDYzUifOi3OLYHHXKnlsOpyeqsd6j1w/Cmzqrz2FGd0lQ Yt5HSsvpzva4/r26xnDedc4uQr1SelldqHlLKmpEmIJbZ8JUCDAwT1vj4/F1pcvzr0ZCK6LXvwo 5o9+ZgjmcOOU= X-Google-Smtp-Source: AGHT+IFv0jDjECPcCbx/BNJrcRuXsTVfA7mx6ZBPiR5Cr5Qd8uEOKs82+tFJ7xIIyNgdz0thgKhOsw== X-Received: by 2002:a05:600c:6297:b0:450:d5ed:3c20 with SMTP id 5b1f17b1804b1-4529abd72bfmr7101445e9.6.1749207419576; Fri, 06 Jun 2025 03:56:59 -0700 (PDT) Received: from NAUSH-P-DELL.tail9c427.ts.net ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-452137277afsm20092455e9.30.2025.06.06.03.56.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Jun 2025 03:56:59 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman , Jacopo Mondi Subject: [PATCH v3 5/6] pipeline: rpi: Remove ispOutputCount_ and ispOutputTotal_ Date: Fri, 6 Jun 2025 11:55:23 +0100 Message-ID: <20250606105651.1624640-6-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250606105651.1624640-1-naush@raspberrypi.com> References: <20250606105651.1624640-1-naush@raspberrypi.com> MIME-Version: 1.0 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" With the drop frame logic removed from the pipeline handler, these member variables and not used, so remove them. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Reviewed-by: Jacopo Mondi --- src/libcamera/pipeline/rpi/common/pipeline_base.h | 6 +----- src/libcamera/pipeline/rpi/pisp/pisp.cpp | 12 ------------ src/libcamera/pipeline/rpi/vc4/vc4.cpp | 15 --------------- 3 files changed, 1 insertion(+), 32 deletions(-) diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.h b/src/libcamera/pipeline/rpi/common/pipeline_base.h index e27c4f860d1a..898f31577059 100644 --- a/src/libcamera/pipeline/rpi/common/pipeline_base.h +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.h @@ -48,8 +48,7 @@ class CameraData : public Camera::Private public: CameraData(PipelineHandler *pipe) : Camera::Private(pipe), state_(State::Stopped), - startupFrameCount_(0), invalidFrameCount_(0), buffersAllocated_(false), - ispOutputCount_(0), ispOutputTotal_(0) + startupFrameCount_(0), invalidFrameCount_(0), buffersAllocated_(false) { } @@ -179,9 +178,6 @@ protected: virtual void tryRunPipeline() = 0; - unsigned int ispOutputCount_; - unsigned int ispOutputTotal_; - private: void checkRequestCompleted(); }; diff --git a/src/libcamera/pipeline/rpi/pisp/pisp.cpp b/src/libcamera/pipeline/rpi/pisp/pisp.cpp index 91e7f4c94d96..ccf135c3d8ce 100644 --- a/src/libcamera/pipeline/rpi/pisp/pisp.cpp +++ b/src/libcamera/pipeline/rpi/pisp/pisp.cpp @@ -1834,12 +1834,6 @@ void PiSPCameraData::beOutputDequeue(FrameBuffer *buffer) dmabufSyncEnd(buffer->planes()[0].fd); handleStreamBuffer(buffer, stream); - - /* - * Increment the number of ISP outputs generated. - * This is needed to track dropped frames. - */ - ispOutputCount_++; handleState(); } @@ -1885,7 +1879,6 @@ void PiSPCameraData::prepareIspComplete(const ipa::RPi::BufferIds &buffers, bool * If there is no need to run the Backend, just signal that the * input buffer is completed and all Backend outputs are ready. */ - ispOutputCount_ = ispOutputTotal_; buffer = cfe_[Cfe::Output0].getBuffers().at(bayerId).buffer; handleStreamBuffer(buffer, &cfe_[Cfe::Output0]); } else @@ -1994,7 +1987,6 @@ int PiSPCameraData::configureBe(const std::optional &yuvColorSpace) global.bayer_enables |= PISP_BE_BAYER_ENABLE_INPUT; global.bayer_order = toPiSPBayerOrder(cfeFormat.fourcc); - ispOutputTotal_ = 1; /* Config buffer */ if (PISP_IMAGE_FORMAT_COMPRESSED(inputFormat.format)) { pisp_decompress_config decompress; decompress.offset = DefaultCompressionOffset; @@ -2025,7 +2017,6 @@ int PiSPCameraData::configureBe(const std::optional &yuvColorSpace) setupOutputClipping(ispFormat0, outputFormat0); be_->SetOutputFormat(0, outputFormat0); - ispOutputTotal_++; } if (global.rgb_enables & PISP_BE_RGB_ENABLE_OUTPUT1) { @@ -2049,7 +2040,6 @@ int PiSPCameraData::configureBe(const std::optional &yuvColorSpace) setupOutputClipping(ispFormat1, outputFormat1); be_->SetOutputFormat(1, outputFormat1); - ispOutputTotal_++; } /* Setup the TDN I/O blocks in case TDN gets turned on later. */ @@ -2256,8 +2246,6 @@ void PiSPCameraData::prepareCfe() void PiSPCameraData::prepareBe(uint32_t bufferId, bool stitchSwapBuffers) { - ispOutputCount_ = 0; - FrameBuffer *buffer = cfe_[Cfe::Output0].getBuffers().at(bufferId).buffer; LOG(RPI, Debug) << "Input re-queue to ISP, buffer id " << bufferId diff --git a/src/libcamera/pipeline/rpi/vc4/vc4.cpp b/src/libcamera/pipeline/rpi/vc4/vc4.cpp index fe910bdf2ff9..ac6dab814d35 100644 --- a/src/libcamera/pipeline/rpi/vc4/vc4.cpp +++ b/src/libcamera/pipeline/rpi/vc4/vc4.cpp @@ -597,8 +597,6 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi stream->setFlags(StreamFlag::External); } - ispOutputTotal_ = outStreams.size(); - /* * If ISP::Output0 stream has not been configured by the application, * we must allow the hardware to generate an output so that the data @@ -625,8 +623,6 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi return -EINVAL; } - ispOutputTotal_++; - LOG(RPI, Debug) << "Defaulting ISP Output0 format to " << format; } @@ -662,8 +658,6 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi << ret; return -EINVAL; } - - ispOutputTotal_++; } /* ISP statistics output format. */ @@ -676,8 +670,6 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi return ret; } - ispOutputTotal_++; - /* * Configure the Unicam embedded data output format only if the sensor * supports it. @@ -843,12 +835,6 @@ void Vc4CameraData::ispOutputDequeue(FrameBuffer *buffer) handleStreamBuffer(buffer, stream); } - /* - * Increment the number of ISP outputs generated. - * This is needed to track dropped frames. - */ - ispOutputCount_++; - handleState(); } @@ -880,7 +866,6 @@ void Vc4CameraData::prepareIspComplete(const ipa::RPi::BufferIds &buffers, << ", timestamp: " << buffer->metadata().timestamp; isp_[Isp::Input].queueBuffer(buffer); - ispOutputCount_ = 0; if (sensorMetadata_ && embeddedId) { buffer = unicam_[Unicam::Embedded].getBuffers().at(embeddedId & RPi::MaskID).buffer;