From patchwork Thu May 22 07:48:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 23420 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 8AD2EC31E9 for ; Thu, 22 May 2025 07:53:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 828D768DA2; Thu, 22 May 2025 09:52:59 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="BahoVvGZ"; dkim-atps=neutral Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EEA8968D7A for ; Thu, 22 May 2025 09:52:50 +0200 (CEST) Received: by mail-wr1-x429.google.com with SMTP id ffacd0b85a97d-3a35c339e95so939798f8f.3 for ; Thu, 22 May 2025 00:52:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1747900370; x=1748505170; 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=oOvFZJc72E4DVqgV4Ge8lUdO/k1QYK9oXX2vR1nJ3A0=; b=BahoVvGZtf23QvJA7T7cG182Urr3LG/yaMfp8yQkUrKinMfkSpVSapL326TEYv+vIp 5hYYkWATG5vwQB2pkRw870VQNLQL9sMGQMTdmuInQdLkN8GzWjkfd/vgoihAjG7BUiTM r+UaVB/rUEq4QmJuuBkmtxKVSSbjPF+TLfqGFIWqYnKTAb1vt7cV7sX30y4r0l3IH0Xv wHlnZIvaFmFV5x1xUffnCgr/Ozj/EBZ79zdEC+7ylAfiQTWZXEGf2pT/CvAMwiQcehoN mwyfE6IM8zIZfm2AQJP0s0Xs+2/YA+vUf2ZnGWEqrRewbulcW3Jg/nz5vfyOG+gmRQtN POPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747900370; x=1748505170; 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=oOvFZJc72E4DVqgV4Ge8lUdO/k1QYK9oXX2vR1nJ3A0=; b=hd8qqJYa1Lnkc/tY3vKl3PU9UlT93D8nFN4dw4iwKkaNUotHyQw1asW0Oaz/4Asxfq pTZctXfqGfn5V34XScf7FynDtcg6d6I3bDIaK0LgKf6wVxZMeSxvAah4tq9oEQ0denNw jASwXrtx6Jhxs93M4i1R6n0oyNjFHnQPEssCavIYvC1HWZXcF950XuZhULciypdt04Or gdDn41IvjDXZR+x7HKJfF6k5+MIgZtZgUxYU6wPGpRyOWX/131JU/bMNycNQRaFah4vr FBfVQeAawwplma58fvie2IwmX1fIS0TjyO8e3JFqOe6k7Kaeafr2rFQ2PIFPys4cjMCR LxdA== X-Gm-Message-State: AOJu0YxenhNJA7qtlaUnqZfdE/kOOg8IWIWcx+ekEnMuYMrrLvljCjHs Nysu1fKRoF7PSYcDFOIOS7L7K9Qeshpxp87wJkn18+ldkyN7Ksani8t0dGjDI7mBiv/VHzvaRiD Shtlf X-Gm-Gg: ASbGnctmf5jMiNmMunoNgUUfC4o5Tjtq0W8iY3MYztEGf55PtAqf+Fbw+GiJ37lw+Hs 0x4lgxNQKN2FpXDVY7gRm9MAZQFZrdEumPvsgyUEezMregeca4DZVxdCNorAl+vhQ9JvZlPAGEE KnlGni2fmnedKisJmkdCVIXk9jmz4DPJvdzkWq65EqncndTiqvsS1OCuq3/5skeCaBW/YHPWuVw /WUx7ZV/Iy8Cr0ikD5RkQfcz8KGmPEsGWILRSoFLtBA4D9flNRAjXrvEmdm5wGqB2U1bvAsbIMf fl8GL+tx8VecJkONJcyPfUHopEWE9NIawvTujxhbEwO6UP+Ep08niH3615jHYQ085u6t+PI= X-Google-Smtp-Source: AGHT+IFejCRPQPwZ22+pMSwxkSO4e98Jdm3FUi0aU/gIYWFTFYMvyyASpXPr+V2s6ykTek974606WQ== X-Received: by 2002:a5d:5848:0:b0:3a0:99a4:e53f with SMTP id ffacd0b85a97d-3a35c843e2cmr6919565f8f.8.1747900370246; Thu, 22 May 2025 00:52:50 -0700 (PDT) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a3ca066eb7sm4191516f8f.2.2025.05.22.00.52.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 May 2025 00:52:49 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck , David Plowman Subject: [PATCH v2 5/6] pipeline: rpi: Remove ispOutputCount_ and ispOutputTotal_ Date: Thu, 22 May 2025 08:48:21 +0100 Message-ID: <20250522075244.1198110-6-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250522075244.1198110-1-naush@raspberrypi.com> References: <20250522075244.1198110-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 --- 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;