[{"id":37850,"web_url":"https://patchwork.libcamera.org/comment/37850/","msgid":"<176907336673.3882822.196406778808309240@neptunite.rasen.tech>","date":"2026-01-22T09:16:06","subject":"Re: [PATCH v1 15/35] ipa: rkisp1: Set frameContext.agc in\n\tqueueRequest for auto mode also","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:39)\n> If the agc is in auto mode, exposure time and gain used to be set on the\n\ns/on/in/\n\n> frame context within prepare(). As exposure time and gain are used by\n> getSensorControls(0) from within start() that is too late (prepare()\n> hasn't run yet). Also prepare() is documented as the place to initialize\n> the params buffer, not the frame context. From the pipeline point of\n> view, prepare() gets called immediately after queueRequest(). Therefore\n> we can safely move setting the frame context into queueRequest() to fix\n> the sensor controls for start().\n\nThis feels weird again because we've put the algo's queueRequest() into start()\neven though the pipeline hasn't actually received a queueRequest yet. But other\nthan that it seems sound to me.\n\n> \n> Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n\n> ---\n>  src/ipa/rkisp1/algorithms/agc.cpp | 8 ++++++--\n>  1 file changed, 6 insertions(+), 2 deletions(-)\n> \n> diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\n> index f5a3c917cb69..c67106339ef8 100644\n> --- a/src/ipa/rkisp1/algorithms/agc.cpp\n> +++ b/src/ipa/rkisp1/algorithms/agc.cpp\n> @@ -284,9 +284,13 @@ void Agc::queueRequest(IPAContext &context,\n>         frameContext.agc.autoExposureEnabled = agc.autoExposureEnabled;\n>         frameContext.agc.autoGainEnabled = agc.autoGainEnabled;\n>  \n> -       if (!frameContext.agc.autoExposureEnabled)\n> +       if (frameContext.agc.autoExposureEnabled)\n> +               frameContext.agc.exposure = context.activeState.agc.automatic.exposure;\n> +       else\n>                 frameContext.agc.exposure = agc.manual.exposure;\n> -       if (!frameContext.agc.autoGainEnabled)\n> +       if (frameContext.agc.autoGainEnabled)\n> +               frameContext.agc.gain = context.activeState.agc.automatic.gain;\n> +       else\n>                 frameContext.agc.gain = agc.manual.gain;\n>  \n>         if (!frameContext.agc.autoExposureEnabled &&\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 840C8BDCBF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 22 Jan 2026 09:16:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2C0C161FE4;\n\tThu, 22 Jan 2026 10:16:14 +0100 (CET)","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 C8DB461FC8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 22 Jan 2026 10:16:12 +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 E15402DD;\n\tThu, 22 Jan 2026 10:15:39 +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=\"CjEpZGut\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1769073340;\n\tbh=lZbAOBMgM+GLqNNOviCNW2rHt58C5hDiZGk77Aqn4KI=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=CjEpZGut+tlzjkSgaQnmjEllMjMD/3t9ugSHBPtXnq/k1CKFQ/IuohcWS6XeSSeLA\n\tAvWQODbKBIVlnji3HtL36Dm8Cz1DtgHTbIKmlaEApu3l6y9G3XKWkZjMwBH+aVQ11t\n\taXKR7ca44Iu0LICYXzho5xRHVqFhbgqlI6IWtXEE=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20251024085130.995967-16-stefan.klug@ideasonboard.com>","References":"<20251024085130.995967-1-stefan.klug@ideasonboard.com>\n\t<20251024085130.995967-16-stefan.klug@ideasonboard.com>","Subject":"Re: [PATCH v1 15/35] ipa: rkisp1: Set frameContext.agc in\n\tqueueRequest for auto mode also","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:16:06 +0900","Message-ID":"<176907336673.3882822.196406778808309240@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>"}}]