[{"id":34276,"web_url":"https://patchwork.libcamera.org/comment/34276/","msgid":"<CAHW6GYJnY8J0PGG_da6JRYiPymYydqGeP98_vLAFfz1iNDucTw@mail.gmail.com>","date":"2025-05-19T10:31:27","subject":"Re: [PATCH v1 5/6] pipeline: rpi: Remove ispOutputCount_ and\n\tispOutputTotal_","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the patch.\n\nOn Mon, 19 May 2025 at 10:23, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\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\nReviewed by: David Plowman <david.plowman@raspberrypi.com>\n\nThanks!\nDavid\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>         CameraData(PipelineHandler *pipe)\n>                 : Camera::Private(pipe), state_(State::Stopped),\n> -                 startupFrameCount_(0), invalidFrameCount_(0), buffersAllocated_(false),\n> -                 ispOutputCount_(0), ispOutputTotal_(0)\n> +                 startupFrameCount_(0), invalidFrameCount_(0), buffersAllocated_(false)\n>         {\n>         }\n>\n> @@ -179,9 +178,6 @@ protected:\n>\n>         virtual void tryRunPipeline() = 0;\n>\n> -       unsigned int ispOutputCount_;\n> -       unsigned int ispOutputTotal_;\n> -\n>  private:\n>         void 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>                 dmabufSyncEnd(buffer->planes()[0].fd);\n>\n>         handleStreamBuffer(buffer, stream);\n> -\n> -       /*\n> -        * Increment the number of ISP outputs generated.\n> -        * This is needed to track dropped frames.\n> -        */\n> -       ispOutputCount_++;\n>         handleState();\n>  }\n>\n> @@ -1885,7 +1879,6 @@ void PiSPCameraData::prepareIspComplete(const ipa::RPi::BufferIds &buffers, bool\n>                  * If there is no need to run the Backend, just signal that the\n>                  * input buffer is completed and all Backend outputs are ready.\n>                  */\n> -               ispOutputCount_ = ispOutputTotal_;\n>                 buffer = cfe_[Cfe::Output0].getBuffers().at(bayerId).buffer;\n>                 handleStreamBuffer(buffer, &cfe_[Cfe::Output0]);\n>         } else\n> @@ -1994,7 +1987,6 @@ int PiSPCameraData::configureBe(const std::optional<ColorSpace> &yuvColorSpace)\n>         global.bayer_enables |= PISP_BE_BAYER_ENABLE_INPUT;\n>         global.bayer_order = toPiSPBayerOrder(cfeFormat.fourcc);\n>\n> -       ispOutputTotal_ = 1; /* Config buffer */\n>         if (PISP_IMAGE_FORMAT_COMPRESSED(inputFormat.format)) {\n>                 pisp_decompress_config decompress;\n>                 decompress.offset = DefaultCompressionOffset;\n> @@ -2025,7 +2017,6 @@ int PiSPCameraData::configureBe(const std::optional<ColorSpace> &yuvColorSpace)\n>                 setupOutputClipping(ispFormat0, outputFormat0);\n>\n>                 be_->SetOutputFormat(0, outputFormat0);\n> -               ispOutputTotal_++;\n>         }\n>\n>         if (global.rgb_enables & PISP_BE_RGB_ENABLE_OUTPUT1) {\n> @@ -2049,7 +2040,6 @@ int PiSPCameraData::configureBe(const std::optional<ColorSpace> &yuvColorSpace)\n>                 setupOutputClipping(ispFormat1, outputFormat1);\n>\n>                 be_->SetOutputFormat(1, outputFormat1);\n> -               ispOutputTotal_++;\n>         }\n>\n>         /* 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> -       ispOutputCount_ = 0;\n> -\n>         FrameBuffer *buffer = cfe_[Cfe::Output0].getBuffers().at(bufferId).buffer;\n>\n>         LOG(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>                 stream->setFlags(StreamFlag::External);\n>         }\n>\n> -       ispOutputTotal_ = outStreams.size();\n> -\n>         /*\n>          * If ISP::Output0 stream has not been configured by the application,\n>          * 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>                         return -EINVAL;\n>                 }\n>\n> -               ispOutputTotal_++;\n> -\n>                 LOG(RPI, Debug) << \"Defaulting ISP Output0 format to \"\n>                                 << format;\n>         }\n> @@ -662,8 +658,6 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi\n>                                         << ret;\n>                         return -EINVAL;\n>                 }\n> -\n> -               ispOutputTotal_++;\n>         }\n>\n>         /* ISP statistics output format. */\n> @@ -676,8 +670,6 @@ int Vc4CameraData::platformConfigure(const RPi::RPiCameraConfiguration *rpiConfi\n>                 return ret;\n>         }\n>\n> -       ispOutputTotal_++;\n> -\n>         /*\n>          * Configure the Unicam embedded data output format only if the sensor\n>          * supports it.\n> @@ -843,12 +835,6 @@ void Vc4CameraData::ispOutputDequeue(FrameBuffer *buffer)\n>                 handleStreamBuffer(buffer, stream);\n>         }\n>\n> -       /*\n> -        * Increment the number of ISP outputs generated.\n> -        * This is needed to track dropped frames.\n> -        */\n> -       ispOutputCount_++;\n> -\n>         handleState();\n>  }\n>\n> @@ -880,7 +866,6 @@ void Vc4CameraData::prepareIspComplete(const ipa::RPi::BufferIds &buffers,\n>                         << \", timestamp: \" << buffer->metadata().timestamp;\n>\n>         isp_[Isp::Input].queueBuffer(buffer);\n> -       ispOutputCount_ = 0;\n>\n>         if (sensorMetadata_ && embeddedId) {\n>                 buffer = 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 94A25C31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 19 May 2025 10:31:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B09AF68D7A;\n\tMon, 19 May 2025 12:31:41 +0200 (CEST)","from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com\n\t[IPv6:2607:f8b0:4864:20::82b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B1C1A68B67\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 May 2025 12:31:39 +0200 (CEST)","by mail-qt1-x82b.google.com with SMTP id\n\td75a77b69052e-476977848c4so46175171cf.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 May 2025 03:31:39 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"QQx7tP51\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1747650698; x=1748255498;\n\tdarn=lists.libcamera.org; \n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=11FhAZ7UjyDrDeqiiHsEI3fGCw+ueqxaAOeg47+OpCg=;\n\tb=QQx7tP51ZXhy00TK6TW2ZSp3wrkg8JxdX39QDLlxrqClrhV3nGs5O+9w8Wt96EOaCD\n\tQLLnMzHP5J57ENUPo3x0zoXV0vxACa64dlLWF+xav6bS1orKoUFuNlzqsBZE3+cpwYTK\n\t+Bv/BkHBRjpfwz2OEMI2NywRS29smJ42LXwRy8HdTHEX/o4rFpPVj6bH73ReiAYAna/V\n\tRmyS4CvVXH6Z/hhRLqVLk0Bc4ojTUpITlgcLcrpD9tvJLo6CMdJzhN1ouckmi1c+dTw7\n\tbs14HyKWaSOAEshhAA3CqwHIDF4ZQOQKRs+Vkz8IPjkeg9QUuxuW898b7YpxqTf0CwRb\n\tNR0Q==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1747650698; x=1748255498;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=11FhAZ7UjyDrDeqiiHsEI3fGCw+ueqxaAOeg47+OpCg=;\n\tb=DCyO5lLoqN/TUEXa9j3h0pHvPchbSlGR9hS/bCQiV3FCZJanWb8rlkalRmc943C1gg\n\tt1jmA2W885sPW/+XopDhd2oX4fWMqY1mdtLgZBxTZKcn0GRPucOlgSlxM8y7HS8IvFTV\n\tNxIyZ5IlNULbcwNgMZ5mfpN7tDIhopCxiP1RYXsMBiD4B6MI1TLU9yHw10rwurVw43ZG\n\toMpuRoLXRo2FnuCw3RLSdZoCG6tgJ6AIwQjDVWr8cP4WFhcIyAiKiWVj0JKl7DjIxExe\n\t3ZYLSJcJyRWFXspT2uwNKYAb1UO33KrEKDmDht1DTxoor/7Qal3vBU5w8pwYi4dt95vy\n\tvXCg==","X-Gm-Message-State":"AOJu0YzlL7hlv7prxtGWvqflRQDQuAmrUIzvJKAJJ7TlWG8f8z5y8LHh\n\t3I2dPVxTxqZG9MFYIkpksKLKD5Y/TMcGzkdNOpZjpSXw73qiszO9I3etvraIwEgqxHjdpcF0TWs\n\tH3d/f6QvkjCwiDoe7nSBzydcP7QEl+2wdKbb/zHC6AHGIKpNIjGKqx2g=","X-Gm-Gg":"ASbGncsov4uKBCqhAJtuW9LeGx5tIhVwU/kIEPRtrRpBWmBkIe9Nbn3s2JQlYGaIHIE\n\tLUB68jxS2/VWSxUVnJEXEB+OMRPTByYNwJG3YKVcD2+BbokfijkMwUC1lSYPv823ghmWjiQL5ae\n\tAO/cZuAzlfCnCNl+m11b+xDpoKb94ojpJw/0+Vjv/wsXlN4FKzZjnqqxdtpaPXdCw=","X-Google-Smtp-Source":"AGHT+IFFljiUAVSg3VkcrFLqkS2U1LSMLIIn0KtJUZJQVePNEgQiCgjvzstixrXSrJnNMnQENMurEScioJIIdSIugwk=","X-Received":"by 2002:a05:622a:2610:b0:476:6b20:2cf3 with SMTP id\n\td75a77b69052e-494ae47dbc3mr226663351cf.33.1747650698424;\n\tMon, 19 May 2025 03:31:38 -0700 (PDT)","MIME-Version":"1.0","References":"<20250519092245.269048-1-naush@raspberrypi.com>\n\t<20250519092245.269048-6-naush@raspberrypi.com>","In-Reply-To":"<20250519092245.269048-6-naush@raspberrypi.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Mon, 19 May 2025 11:31:27 +0100","X-Gm-Features":"AX0GCFvEilwPTFgZeCTzA4QIQl3Lmzq5NUAwb5eZmWY6uEzYmsuB345pyMAWVtc","Message-ID":"<CAHW6GYJnY8J0PGG_da6JRYiPymYydqGeP98_vLAFfz1iNDucTw@mail.gmail.com>","Subject":"Re: [PATCH v1 5/6] pipeline: rpi: Remove ispOutputCount_ and\n\tispOutputTotal_","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","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>"}}]