[{"id":37848,"web_url":"https://patchwork.libcamera.org/comment/37848/","msgid":"<176907334936.3882822.3598584488440443308@neptunite.rasen.tech>","date":"2026-01-22T09:15:49","subject":"Re: [PATCH v1 12/35] pipeline: rkisp1: Fix controls in raw mode","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Stefan Klug (2025-10-24 17:50:36)\n> After the pipeline restructuring setSensorControls is no longer emitted\n> within process() but within computeParams(). In raw mode computeParams\n> is not called and therefore setSensorControls is never emitted. Fix that\n> by allowing computeParams to be called with an empty bufferId. This\n> strategy is also used for processStats() to ensure that metadata gets\n> filled in raw mode.  Then call computeParams within frameStart() when in\n> raw mode.\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n> ---\n>  src/ipa/rkisp1/rkisp1.cpp                | 12 ++++++++++++\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp |  4 ++++\n>  2 files changed, 16 insertions(+)\n> \n> diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\n> index ab8583e389d3..ee87c899fcb1 100644\n> --- a/src/ipa/rkisp1/rkisp1.cpp\n> +++ b/src/ipa/rkisp1/rkisp1.cpp\n> @@ -343,6 +343,18 @@ void IPARkISP1::computeParams(const uint32_t frame, const uint32_t bufferId)\n>  {\n>         IPAFrameContext &frameContext = context_.frameContexts.get(frame);\n>  \n> +       /*\n> +        * \\todo: This needs discussion. In raw mode, computeParams is\n> +        * called without a params buffer, to trigger the setSensorControls\n> +        * signal. Currently our algorithms don't support prepare calls with\n> +        * a nullptr. Do we need that or can we safely skip it?\n\nAt first I thought we could just use the same patterns as in processStats() and\ncheck if (algo->disabled_) but then I realized there's not much point in\nprepare()ing in the first place since there are no stats. The manual controls\nare handled in queueRequest and the metadata and state is handled in process.\n\nWe can keep the todo though, to document the debate.\n\n> +        */\n> +       if (bufferId == 0) {\n> +               ControlList ctrls = getSensorControls(frameContext);\n> +               setSensorControls.emit(frame, ctrls);\n> +               return;\n> +       }\n> +\n>         RkISP1Params params(context_.configuration.paramFormat,\n>                             mappedBuffers_.at(bufferId).planes()[0]);\n>  \n> diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> index 9be9f44db479..0e6e45bba75b 100644\n> --- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> +++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n> @@ -1618,6 +1618,10 @@ void PipelineHandlerRkISP1::frameStart(uint32_t sequence)\n>  \n>         RkISP1CameraData *data = cameraData(activeCamera_);\n>         data->delayedCtrls_->applyControls(sequence);\n> +\n> +       if (isRaw_) {\n> +               data->ipa_->computeParams(sequence + 1, 0);\n> +       }\n\nI don't think we need the braces.\n\nWhat's the reason that this is here instead of in queueRequestDevice like the\nnon-raw case?\n\n\nPaul\n\n>  }\n>  \n>  bool PipelineHandlerRkISP1::match(DeviceEnumerator *enumerator)\n> -- \n> 2.48.1\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 83565BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Jan 2026 09:15:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 416E561FC8;\n\tThu, 22 Jan 2026 10:15:57 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7C11261FBB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Jan 2026 10:15:55 +0100 (CET)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:8816:a947:ebed:2ec7])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 885512DD;\n\tThu, 22 Jan 2026 10:15:22 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"CQwJJMUB\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1769073323;\n\tbh=EVsdJ7B2ocoQM54B718OwOOkGQ1FWvw+XEDv9Ks+GII=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=CQwJJMUBDL1616DuJ9tbgOmJJN7SBzxJ4TrArsjY8hPSQnoq/QGsw4qXCh8PrTfzs\n\t933ZYYe+eddq6ytjJYG/YotQYw+4zcCQyqCO0gfMo6hqBucD0ihYBcJ6kr+RFzPSHH\n\t5lrCLQQIU/HPTzu3WM5yCKpAKJOZ11lzUhkPQ6iU=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251024085130.995967-13-stefan.klug@ideasonboard.com>","References":"<20251024085130.995967-1-stefan.klug@ideasonboard.com>\n\t<20251024085130.995967-13-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v1 12/35] pipeline: rkisp1: Fix controls in raw mode","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"Stefan Klug <stefan.klug@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 22 Jan 2026 18:15:49 +0900","Message-ID":"<176907334936.3882822.3598584488440443308@neptunite.rasen.tech>","User-Agent":"alot/0.0.0","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>"}}]