[{"id":33904,"web_url":"https://patchwork.libcamera.org/comment/33904/","msgid":"<174366792016.4065590.17879225024541764303@ping.linuxembedded.co.uk>","date":"2025-04-03T08:12:00","subject":"Re: [PATCH v7 4/5] pipeline: simple: Create DelayedControls instance\n\tonce only","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Stanislaw Gruszka (2025-04-03 08:45:50)\n> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> \n> The DelayedControls instance for the camera sensor is created in\n> SimplePipelineHandler::configure(). Constant deletion and reconstruction\n> of a new object is unnecessary, as the control delays are an intrinsic\n> property of the sensor and are known at initialization time. Move the\n> DelayedControls creation to the SimpleCameraData class constructor.\n> \n> Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com> # v6\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> Signed-off-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nI'll test this series on the x13s and merge as long as it's all fine.\n\n--\nKieran\n\n> ---\n>  src/libcamera/pipeline/simple/simple.cpp | 16 +++++++---------\n>  1 file changed, 7 insertions(+), 9 deletions(-)\n> \n> diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\n> index c97904076b63..262192b849e2 100644\n> --- a/src/libcamera/pipeline/simple/simple.cpp\n> +++ b/src/libcamera/pipeline/simple/simple.cpp\n> @@ -542,6 +542,13 @@ SimpleCameraData::SimpleCameraData(SimplePipelineHandler *pipe,\n>         if (!sensor_)\n>                 return;\n>  \n> +       const CameraSensorProperties::SensorDelays &delays = sensor_->sensorDelays();\n> +       std::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n> +               { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n> +               { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n> +       };\n> +       delayedCtrls_ = std::make_unique<DelayedControls>(sensor_->device(), params);\n> +\n>         LOG(SimplePipeline, Debug)\n>                 << \"Found pipeline: \"\n>                 << utils::join(entities_, \" -> \",\n> @@ -1388,15 +1395,6 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n>         if (outputCfgs.empty())\n>                 return 0;\n>  \n> -       const CameraSensorProperties::SensorDelays &delays = data->sensor_->sensorDelays();\n> -       std::unordered_map<uint32_t, DelayedControls::ControlParams> params = {\n> -               { V4L2_CID_ANALOGUE_GAIN, { delays.gainDelay, false } },\n> -               { V4L2_CID_EXPOSURE, { delays.exposureDelay, false } },\n> -       };\n> -       data->delayedCtrls_ =\n> -               std::make_unique<DelayedControls>(data->sensor_->device(),\n> -                                                 params);\n> -\n>         StreamConfiguration inputCfg;\n>         inputCfg.pixelFormat = pipeConfig->captureFormat;\n>         inputCfg.size = pipeConfig->captureSize;\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 1293AC3213\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  3 Apr 2025 08:12:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AD88F6899C;\n\tThu,  3 Apr 2025 10:12:04 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9591468967\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  3 Apr 2025 10:12:02 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3092A105D;\n\tThu,  3 Apr 2025 10:10:09 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"cWdC8aDR\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1743667809;\n\tbh=ZSDZrFfPGWsskw0vRdZzniIsePQyYYaqHbOn3zOIQx0=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=cWdC8aDRTRsunFmS/WJBwgNHng5brlA+X1yP7bpLhwogpimpyWHkLw0F2MuKfGKiX\n\tcUELwyR+vOd+uprb9aHVuGZw5Z0mg3+T7dn0312BDv69wfAWfKLwU6LtaoC7YO7zBq\n\tsoM7G6lxG5+14Hg3wHsbeQEoT8/cGJSK+3Kcw75c=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250403074551.263496-5-stanislaw.gruszka@linux.intel.com>","References":"<20250403074551.263496-1-stanislaw.gruszka@linux.intel.com>\n\t<20250403074551.263496-5-stanislaw.gruszka@linux.intel.com>","Subject":"Re: [PATCH v7 4/5] pipeline: simple: Create DelayedControls instance\n\tonce only","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Milan Zamazal <mzamazal@redhat.com>, Hans de Goede <hdegoede@redhat.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>,\n\tSakari Ailus <sakari.ailus@linux.intel.com>,\n\tStefan Klug <stefan.klug@ideasonboard.com>","To":"Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 03 Apr 2025 09:12:00 +0100","Message-ID":"<174366792016.4065590.17879225024541764303@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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>"}}]