From patchwork Wed May 7 07:52:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 23346 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 6132BC3226 for ; Wed, 7 May 2025 08:28:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4E77768B34; Wed, 7 May 2025 10:28:14 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="m8bRhiI7"; dkim-atps=neutral Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8B7A768B33 for ; Wed, 7 May 2025 10:28:01 +0200 (CEST) Received: by mail-wr1-x431.google.com with SMTP id ffacd0b85a97d-3a0b0dd3b5bso161521f8f.1 for ; Wed, 07 May 2025 01:28:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1746606481; x=1747211281; 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=HyZHAEPEvRlhx9HxiH7c+Sa84pjnUrsNuklV5311nY4=; b=m8bRhiI7VHLdkVmYaGltNOAzXLNhftjO5FNcHyDA4DsLNAOG1erw4y7NjRLeXAkFGN hUfkWK5W/kUEpRY0DL/Vxs6cxamXT8dgch7ebMbFzpS/xEypf5mmMacUOIqJPKKVGoUe w0xaYUIHE1QOJNBXfPKAsI9FFGcBk1IGY0Lhug1zAnQsZcaYCZgMgOC4jBSw5qiWATkj creDKIz/m0Kz2IoeLZbp2n4NO2ryO0hAJGYeaHg+K3yRd3qkUt6YjRHR6uKAEHMnp+A6 CfgYRmyUGQJFtaYnz22N3pv17sabPNyp5jD7W4JRaLOQn/4v2YkJrPXbjWfncExulsWw 8Kkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746606481; x=1747211281; 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=HyZHAEPEvRlhx9HxiH7c+Sa84pjnUrsNuklV5311nY4=; b=A77v3m4JVBQDG3YxkkL8pkeqg0KlF07KS0CxE6I6MSemeQUN/al7EjSMc5t/YRk+WI o7kzZRgQuml8vrQe0LoTPCB7cdSoMMwXMZjP1ZH0cYF/lbJH/5lm4obHvRRBxO7Q9sLk das5Eegp2zn2gEkCCFNIx91WckGdmDDimSlEz38U2v5uyD2vZdO6/ehw6Ql46JnJ2RXC CL/oJkyQgjNgmEK45eGn66zwLtfP8QvbCuMAF2bnOE9Cb/oFbWFgXAM/at6lqidTLYcz DSgjJqFkw+MUrK/gX736zAz3fZ2WA/EglWLSVclbEltpg1V47BPK2xNKO1wrRc12YE5W 48pw== X-Gm-Message-State: AOJu0Yz2YgjNqszihTc+E4zkGwVbTkNWocMk51nT94GPCv5pyL5pKZqv dKFWP2CGaPOicE1Yq42XizK0eEo+4OQg6LrRKnoX9iIZGCaccdBeWjByIOqdaH9LfgE3NHJYw9U I X-Gm-Gg: ASbGncuKEDYHGrY+hh6fNU3QtDJXs51HHYE/I+d2vvC6LHdZtg23j8NLgSvxz+CXstS bNqcA3aeYWhHhQ6+gVXTHpfyL2LD3b6X+SPTkFwZvNFW521heUo82s1sfnpPWTtlVYG0Qbyx2Ur PzDzJ9UUSFmR7mUdfzV8nBIf5Zm9yJ1KUF45FsGRMGpMFE8sl9kyibH2Ge3levmzqZxh+HLX5Ud 2OZDjDdKDz85g57ecgF7qHLPW58jVymkzrWFt/ZkX7xY1+g1qQiMoX5ANwZX4zYgcxv2qRQ6bVI Px7m8cgqgxuhOwpSWKLEKol9hCgB6zxagKqEJK2nhWRUpRCCeez0UvvexH6V X-Google-Smtp-Source: AGHT+IGr21+tSsVRDiZfnP+i3RPITy8FkNZSO/gplnSdPsan+gGNn9X3G630ixx1It6KluUfyt+SZQ== X-Received: by 2002:a05:600c:3d9b:b0:439:9a1f:d73d with SMTP id 5b1f17b1804b1-441d44ecc08mr5683615e9.8.1746606480774; Wed, 07 May 2025 01:28:00 -0700 (PDT) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-441d440fff6sm22182575e9.25.2025.05.07.01.28.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 07 May 2025 01:28:00 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [RFC PATCH 5/6] pipeline: rpi: Remove ispOutputCount_ and ispOutputTotal_ Date: Wed, 7 May 2025 08:52:12 +0100 Message-ID: <20250507082753.2306743-6-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250507082753.2306743-1-naush@raspberrypi.com> References: <20250507082753.2306743-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 --- 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;