From patchwork Mon May 19 09:20:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 23390 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 050F2C331E for ; Mon, 19 May 2025 09:23:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C957768D7A; Mon, 19 May 2025 11:23:03 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="nnnrMIs3"; dkim-atps=neutral Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8A0D268D7A for ; Mon, 19 May 2025 11:22:54 +0200 (CEST) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-43cfe99f2a7so4145935e9.2 for ; Mon, 19 May 2025 02:22:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1747646574; x=1748251374; 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=nnnrMIs3iphU3CGkXZZcEhkBGAeJj5olIpVvhPpyJ8zyGYYSbDmwKCw3EjdLMeARGs OoO7G+U2gAB5yE8c89SPWhXstHTv6uKZ7JfWvv3cickd8jR72BOH0ljkTJNE1Lf4D9c3 v/a1BG0uVIBVse0otbRxjrLmzU4eXvv0ntw9TD8qPG5KjyGopfcI3HBcKdZjPeYoHcoc CTvZU/vSG0CI6yt2zpkdkfWtihcN21GU5B0UCDvzCtuCmNopVdgg1tBCNCxqXPANroSp jbaZK0o0qSCntTetb89eug0ct8f8jnMCXs/Vu0dYIIjOF/Lvgxi3dJ7Bn559xBcrkUvC uLcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747646574; x=1748251374; 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=eqRDyLHBUsW2lfWCRgTAYeGZFdf4/LUVV2vx9ZDRdWHrCxWydKiNRgdhrL/tnodBST 24TMY087A5jVRUvf0sA11/nyZMVTHpt5pAyKuX2kCzbpjATHrTRNNktb8GhxKI9TrIjB pxUyWA5goxaOUT+QruVwwap2iaC0lvccpYOQBxf/fS8hg3ihoRVabThuj4xOE9dqGR5w dSJvH24AXsMh+xEEwZpWjks+IU9qbWL2eNDgz9q2c+zbOOWtaBq/QkMTUR93LiFohrZv suJl8AI3iuf+7XJC8v0wDiDIvsILwmNuEEpvYzpef/atA9g7P+Xo7tb9oH977dNz41Fi w+6A== X-Gm-Message-State: AOJu0Yw9fhSoaIceRRg1fFfA/9eT2DepakWRAOCRdRIn7ybZibFQa6+h IUpCsK9AdiVGDuuaPctmXULo+z1BFbE5hKKP9D4A1oWUxaRXm8PPk/Hm03rhsKY9dWAsumF7AoU GXHi3 X-Gm-Gg: ASbGncv1WwNcNFP5MU3F1ASuL0lsDSnLX5OGrJ9t5bTvt53wL8ASPrtPK0U3YGs9fZI zX1cVoRQ+ZtYS+IISCtvvto2FIyMODDmw/JFtnhELkSvdgC9q1fPFTwqjOvCe6IwS9BAu0DAUYO QIbdpmaFSIG/Jl86GLHWrEUwfpV/lgOa6FgV4U9YgS/kjGJ/meMKX+fk4t8yk+N9CqPlVzZ7uXH JR7ao9jYjlFWIAfVXVEJcu7SC+CxN/EFQEcal0qoGt14VTTj1JIBudBq+VaVwVfJV/Ii+gwapey QKB38Lv5z8NbAqRFnX8qw3B61sT0XnIAg1JiJ0Ej3CVS3WqwtUtoF70CRm+H7IJ/q8nlMWTIssF l7yBmPg== X-Google-Smtp-Source: AGHT+IHKPj7U53tgMhR2lnKh+fg6qYusXxNLkRdDDXG0VWXDG5P+fTTEsONIbP1RoZYb/4yalhxSsQ== X-Received: by 2002:a05:600d:108:10b0:43b:c0fa:f9bf with SMTP id 5b1f17b1804b1-442fd7165b7mr21711295e9.3.1747646573789; Mon, 19 May 2025 02:22:53 -0700 (PDT) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a366e08747sm8645961f8f.95.2025.05.19.02.22.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 May 2025 02:22:53 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: Naushir Patuck Subject: [PATCH v1 5/6] pipeline: rpi: Remove ispOutputCount_ and ispOutputTotal_ Date: Mon, 19 May 2025 10:20:53 +0100 Message-ID: <20250519092245.269048-6-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250519092245.269048-1-naush@raspberrypi.com> References: <20250519092245.269048-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;