[{"id":36376,"web_url":"https://patchwork.libcamera.org/comment/36376/","msgid":"<352b308a-7876-42e5-910d-22c47cbb082c@collabora.com>","date":"2025-10-21T12:12:54","subject":"Re: [PATCH 0/3] rkisp1: Update exposure limits on vblank change","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"Hi Jacopo, thank you for the series - I quickly tested it on the \nPinePhone Pro and can confirm that it fixes way too low frame rates with \nthe back-camera that are reliably reproducible on master.\n\nOn 10/17/25 11:00, Jacopo Mondi wrote:\n> By definition, the exposure time that can be programmed on a sensor is\n> limited by the frame duration and whenever the frame duration is\n> updated, the exposure time limits should be updated as well.\n>\n> This is not the case in the RkISP1 IPA, where the exposure limits\n> are computed at configure() time and never updated.\n>\n> This has two implications:\n> 1) The AGC algorithms will always operate with an exposure time bound to\n>     the frame duration programmed at startup time\n> 2) The Camera::controls() limits are not updated to reflect the new\n>     constraints\n>\n> This series addresses the above issues with 2 patches.\n>\n> The first one for the IPA simply updates the exposure limts whenever the\n> VBLANK changes in response to a FrameDurationLimits change.\n>\n> The second one for the IPA/pipeline introduces a new operation in the\n> IPA interface which the pipeline handler calls to have the limits of the\n> controls registered by the IPA updated.\n>\n> The timing of these two operations is critical.\n>\n> The IPA limits should be updated whenever a new VBLANK is computed. The\n> actual blanking value on the sensor will be changed with a few\n> frames of latency by DelayedControls, but for the IPA this is not\n> relevant as all the computations for the 'next' frames will be delayed\n> by the same latency and should use the new limits.\n>\n> The Camera::controls() limits should instead be updated when the Request\n> with the updated FrameDurationLimits completes. For this reason the new\n> 'updateControlsLimits()' IPA operation is called before completing a\n> Request on the pipeline handler side.\n>\n> Finally, the last patch, not meant for inclusion, validates that the\n> Camera::controls() limits are updated correctly. The IPA limits update\n> has been visually validated with camshark by tuning the\n> FrameDurationLimits control and verifying the AGC algorithm limits are\n> updated accordingly.\n>\n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> ---\n> Jacopo Mondi (3):\n>        ipa: rkisp1: Update exposure limits on vblank change\n>        libcamera: rkisp1: Update camera::controls() on limit changes\n>        DNI: cam: Test Camera::controls() update with capture script\n>\n>   change-frame-duration.yaml               |  4 +++\n>   include/libcamera/ipa/rkisp1.mojom       |  2 ++\n>   src/apps/cam/camera_session.cpp          | 21 ++++++++++++\n>   src/ipa/rkisp1/algorithms/agc.cpp        |  3 ++\n>   src/ipa/rkisp1/ipa_context.h             |  5 ++-\n>   src/ipa/rkisp1/rkisp1.cpp                | 57 ++++++++++++++++++++++++++++++--\n>   src/libcamera/pipeline/rkisp1/rkisp1.cpp |  3 ++\n>   7 files changed, 91 insertions(+), 4 deletions(-)\n> ---\n> base-commit: b9fa6e0e61d3ea605fe4b1201ede5745cd5800e5\n> change-id: 20251017-exposure-limits-5c48252fe548\n>\n> Best regards,","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 D03A4C3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 21 Oct 2025 12:13:05 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B4E9F60774;\n\tTue, 21 Oct 2025 14:13:04 +0200 (CEST)","from sender4-op-o12.zoho.com (sender4-op-o12.zoho.com\n\t[136.143.188.12])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 61B306075B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 21 Oct 2025 14:13:02 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1761048776272821.7298164028786;\n\tTue, 21 Oct 2025 05:12:56 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"MS5MfenD\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1761048778; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=e7qkQe2QyP19+C0uFaG6H+7Mh2gK4/riASBGkN6/8LSymxUHKaBIoFxSLP82jwlVCtXGQ7zeT3I8qUwfco1mnrLZeqdUpeu14Q+hsbuGW1fr7l0/nAtHIVfG3IaQ4vmt3wYtXONDJ8/9m6CBOoMyiyMEJKHl8Og6KHFK51XPmqQ=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1761048778;\n\th=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=DtPGKh/SS09F8sa5MHJXtLxQNEdKhbjSShBxUuhQjao=; \n\tb=kiUtFOTC6mG9BJMubBauZkGh561eylXMESnzcdpfHeJlAGZ9OdBWV/zn0Y5xNJj7AF0nps++eA9Sly/muCirJyrn7cw+XhzYaExlV/3U5mLQugRLMz2kLV4yEYz8p/YgRIf717A0jyMx8CBvIDKvIf9VGilTszhJYAwk0uzzmQQ=","ARC-Authentication-Results":"i=1; mx.zohomail.com;\n\tdkim=pass  header.i=collabora.com;\n\tspf=pass  smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1761048778;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc;\n\tbh=DtPGKh/SS09F8sa5MHJXtLxQNEdKhbjSShBxUuhQjao=;\n\tb=MS5MfenDteRCUhxLMIepUwdmMofnUbX5cyX+yf+p9GJaFOBcvdcQyFTZcx6l81RI\n\tx+fzWQ5N5Zmt7ZoaSariUzT5+e72M2H/4dYtRo9v0a0gq4uRvI1XyFcb3vhoR9gs8oR\n\tua35XGQpEVBuljtsDd7u+Ix+ZkeQRYpg09reiZnU=","Message-ID":"<352b308a-7876-42e5-910d-22c47cbb082c@collabora.com>","Date":"Tue, 21 Oct 2025 14:12:54 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 0/3] rkisp1: Update exposure limits on vblank change","To":"libcamera-devel@lists.libcamera.org","References":"<20251017-exposure-limits-v1-0-6288cd86e719@ideasonboard.com>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<20251017-exposure-limits-v1-0-6288cd86e719@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","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>"}},{"id":36383,"web_url":"https://patchwork.libcamera.org/comment/36383/","msgid":"<4u4ulytfimjzgtmobsyu7ypou2hsuww6ze5ilwp6x5fe327cbw@amutfpr45aj2>","date":"2025-10-22T07:23:54","subject":"Re: [PATCH 0/3] rkisp1: Update exposure limits on vblank change","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Robert,\n\nOn Tue, Oct 21, 2025 at 02:12:54PM +0200, Robert Mader wrote:\n> Hi Jacopo, thank you for the series - I quickly tested it on the PinePhone\n> Pro and can confirm that it fixes way too low frame rates with the\n> back-camera that are reliably reproducible on master.\n\nAh that's great. Thanks for testing.\n\nDoes it mean I can add your tag to at least 1/3 ?\n\nThanks\n  j\n\n>\n> On 10/17/25 11:00, Jacopo Mondi wrote:\n> > By definition, the exposure time that can be programmed on a sensor is\n> > limited by the frame duration and whenever the frame duration is\n> > updated, the exposure time limits should be updated as well.\n> >\n> > This is not the case in the RkISP1 IPA, where the exposure limits\n> > are computed at configure() time and never updated.\n> >\n> > This has two implications:\n> > 1) The AGC algorithms will always operate with an exposure time bound to\n> >     the frame duration programmed at startup time\n> > 2) The Camera::controls() limits are not updated to reflect the new\n> >     constraints\n> >\n> > This series addresses the above issues with 2 patches.\n> >\n> > The first one for the IPA simply updates the exposure limts whenever the\n> > VBLANK changes in response to a FrameDurationLimits change.\n> >\n> > The second one for the IPA/pipeline introduces a new operation in the\n> > IPA interface which the pipeline handler calls to have the limits of the\n> > controls registered by the IPA updated.\n> >\n> > The timing of these two operations is critical.\n> >\n> > The IPA limits should be updated whenever a new VBLANK is computed. The\n> > actual blanking value on the sensor will be changed with a few\n> > frames of latency by DelayedControls, but for the IPA this is not\n> > relevant as all the computations for the 'next' frames will be delayed\n> > by the same latency and should use the new limits.\n> >\n> > The Camera::controls() limits should instead be updated when the Request\n> > with the updated FrameDurationLimits completes. For this reason the new\n> > 'updateControlsLimits()' IPA operation is called before completing a\n> > Request on the pipeline handler side.\n> >\n> > Finally, the last patch, not meant for inclusion, validates that the\n> > Camera::controls() limits are updated correctly. The IPA limits update\n> > has been visually validated with camshark by tuning the\n> > FrameDurationLimits control and verifying the AGC algorithm limits are\n> > updated accordingly.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> > ---\n> > Jacopo Mondi (3):\n> >        ipa: rkisp1: Update exposure limits on vblank change\n> >        libcamera: rkisp1: Update camera::controls() on limit changes\n> >        DNI: cam: Test Camera::controls() update with capture script\n> >\n> >   change-frame-duration.yaml               |  4 +++\n> >   include/libcamera/ipa/rkisp1.mojom       |  2 ++\n> >   src/apps/cam/camera_session.cpp          | 21 ++++++++++++\n> >   src/ipa/rkisp1/algorithms/agc.cpp        |  3 ++\n> >   src/ipa/rkisp1/ipa_context.h             |  5 ++-\n> >   src/ipa/rkisp1/rkisp1.cpp                | 57 ++++++++++++++++++++++++++++++--\n> >   src/libcamera/pipeline/rkisp1/rkisp1.cpp |  3 ++\n> >   7 files changed, 91 insertions(+), 4 deletions(-)\n> > ---\n> > base-commit: b9fa6e0e61d3ea605fe4b1201ede5745cd5800e5\n> > change-id: 20251017-exposure-limits-5c48252fe548\n> >\n> > Best regards,\n>\n> --\n> Robert Mader\n> Consultant Software Developer\n>\n> Collabora Ltd.\n> Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK\n> Registered in England & Wales, no. 5513718\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 AFBD5BE080\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 22 Oct 2025 07:23:59 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6370F6079B;\n\tWed, 22 Oct 2025 09:23:59 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CAD1760790\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Oct 2025 09:23:58 +0200 (CEST)","from ideasonboard.com (mob-5-90-62-95.net.vodafone.it [5.90.62.95])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B16BA557;\n\tWed, 22 Oct 2025 09:22:14 +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=\"jsxwLZIb\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761117734;\n\tbh=2sFSjqdEvfQjzFN4G3hzHwi0yk5dhgaJ2pMoa6hX9gc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=jsxwLZIbMZ1lhWrc0vqBGJDKgJ+KFGptU6L2xwfu9UzspiqMa4isLerVv0YEk6Ddw\n\t61Fxv29vwYfz628ZbUcwZ4W/Y4lXMC87oldKlXxKYdY7TuPAhDmYkemZOMxvkSlkRg\n\tb45Rl//AWwinxODtZYtQPfdse86kosxNMntuQOjQ=","Date":"Wed, 22 Oct 2025 09:23:54 +0200","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"Robert Mader <robert.mader@collabora.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 0/3] rkisp1: Update exposure limits on vblank change","Message-ID":"<4u4ulytfimjzgtmobsyu7ypou2hsuww6ze5ilwp6x5fe327cbw@amutfpr45aj2>","References":"<20251017-exposure-limits-v1-0-6288cd86e719@ideasonboard.com>\n\t<352b308a-7876-42e5-910d-22c47cbb082c@collabora.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<352b308a-7876-42e5-910d-22c47cbb082c@collabora.com>","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>"}}]