Cover Letter Detail
Show a cover letter.
GET /api/covers/25052/?format=api
{ "id": 25052, "url": "https://patchwork.libcamera.org/api/covers/25052/?format=api", "web_url": "https://patchwork.libcamera.org/cover/25052/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>", "date": "2025-11-14T14:16:55", "name": "[v3,00/19] libipa: agc: Calculate exposure limits", "submitter": { "id": 143, "url": "https://patchwork.libcamera.org/api/people/143/?format=api", "name": "Jacopo Mondi", "email": "jacopo.mondi@ideasonboard.com" }, "mbox": "https://patchwork.libcamera.org/cover/25052/mbox/", "series": [ { "id": 5590, "url": "https://patchwork.libcamera.org/api/series/5590/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5590", "date": "2025-11-14T14:16:55", "name": "libipa: agc: Calculate exposure limits", "version": 3, "mbox": "https://patchwork.libcamera.org/series/5590/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/covers/25052/comments/", "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 48A02C3241\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 Nov 2025 14:17:21 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CD5EB60AA2;\n\tFri, 14 Nov 2025 15:17:19 +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 97915606E6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Nov 2025 15:17:17 +0100 (CET)", "from [192.168.1.101] (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 60258664;\n\tFri, 14 Nov 2025 15:15:16 +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=\"Os/dYRoJ\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1763129716;\n\tbh=8m+wntdMi41yAY12WJr2lymuQSVkTRfXUOaNIIQ/pgY=;\n\th=From:Subject:Date:To:Cc:From;\n\tb=Os/dYRoJl0Yz0JEw4MHiRcHvSPMmOhQ/vH+PO1toBPS8jwseBDDf+vSmZoDXLVCdV\n\t5DwT25P1lc/uX1X1hOMsDxT7sn1VBSSPiRhW7rkZiM1FEnI9UU9+Sa09OMqxBIw0JI\n\tVwJBiFFaSeb3uXjzjtYGRowROmZLog9t7BZQ0QVk=", "From": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>", "Subject": "[PATCH v3 00/19] libipa: agc: Calculate exposure limits", "Date": "Fri, 14 Nov 2025 15:16:55 +0100", "Message-Id": "<20251114-exposure-limits-v3-0-b7c07feba026@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "7bit", "X-B4-Tracking": "v=1; b=H4sIANc5F2kC/3XNQQ6CMBCF4auQrq2hUwrVlfcwLko7yCRCSYsEQ\n\t7i7hZWJuvxfMt8sLGIgjOycLSzgRJF8n0IeMmZb09+Rk0vNIAclclFxnAcfnwH5gzoaI1e20KC\n\tgQVVolq6GgA3Nu3i9pW4pjj689geT2Nb/1iR4zkvQ2jpdYiVOF3Joou9rb4I7Wt+xjZzggwH9z\n\tUBijK6VkUJLkPiDWdf1DYe/8o/8AAAA", "X-Change-ID": "20251017-exposure-limits-5c48252fe548", "To": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>,\n\tRobert Mader <robert.mader@collabora.com>, \n\tlibcamera-devel@lists.libcamera.org", "Cc": "Jacopo Mondi <jacopo.mondi@ideasonboard.com>, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>, \n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>", "X-Mailer": "b4 0.14.2", "X-Developer-Signature": "v=1; a=openpgp-sha256; l=6916;\n\ti=jacopo.mondi@ideasonboard.com; h=from:subject:message-id;\n\tbh=8m+wntdMi41yAY12WJr2lymuQSVkTRfXUOaNIIQ/pgY=;\n\tb=owEBbQKS/ZANAwAKAXI0Bo8WoVY8AcsmYgBpFznqH5VqjBHjuj49na25tTYxEBRHEpH9t5XnT\n\tpSBKQtYCxeJAjMEAAEKAB0WIQS1xD1IgJogio9YOMByNAaPFqFWPAUCaRc56gAKCRByNAaPFqFW\n\tPHAFEACe1n3QR3/e79KOaaLm4OQYXnlFQuiWNBjhn8Db3GWXPfBeCGlSgOTgxFONlLF6t0Ka3sr\n\t+V4V8m+T38BfjjUwEj17hVCQmIz5IJhzxE4n0US5+X9bUqP6HPF7ouloopnd12fRBTyU5lbvWlH\n\tarL16ez8IkKY1d/ivbgLryOSG5Fmz8ddaG6/Vd3caLHhQWD/c3SFYfxUH9j62KlWCPGX9x/pELs\n\tHpkUL5aPM27Mi6Bq6FTB8V7GOE+/8n1cAkrIdM67h3uJ0w/2qoAu+lv/N4DurIpz36ZGe8hmQ6U\n\tv35cdlsi/dJ6aAllKa8GzE8NVVw4IB7IqPb/g2taEaCpsGMqn8VYSmCzSQNkiCx1P5+Qz8vMrpI\n\tLoOXSNr4EACOoaNrGAD0Va6XlbmCkNuPo9NHJ0fPCWM43omn5nnU3sPT31rYiuMQwOj/E4OW1XI\n\tTiji23JzCQEkHGFbbdBWJeWX53JAUOGNI5dLZ6eq7wjq1Snejm3g6mhbJZ1aicmLBqMRg4vq/nu\n\t1i4nDQUFMv2TV007txdvWk+4JFbHu/ryG5BMBnFPN/BrZmYxb911oopRzud/8J1WTGsnRKWzBty\n\toEw9SrDroXp9Nnna5FjPTS14TRjOMh0jE81uYdgsyCsvssqaIclrruGYuUlI0qGBlQA1vTWOm3z\n\tCnyVLgtFzjgX6/A==", "X-Developer-Key": "i=jacopo.mondi@ideasonboard.com; a=openpgp;\n\tfpr=72392EDC88144A65C701EA9BA5826A2587AD026B", "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>" }, "content": "By definition, the exposure time that can be programmed on a sensor is\nlimited by the frame duration and whenever the frame duration is\nupdated, the exposure time limits should be updated as well.\n\nThis is not the case for IPAs using the AgcMeanLuminance algorithm from\nlibipa, where the exposure limits are computed at configure() time and\nnever updated.\n\nThis has two implications:\n1) The AGC algorithms will always operate with an exposure time bound to\n the frame duration programmed at startup time\n2) The Camera::controls() limits are not updated to reflect the new\n constraints\n\nThis series addresses issue 1) by changing the AgcMeanLuminance class\nand the associated helpers to regulate the exposure time base on the\ncurrently programmed max frame duration using a sensor-specific margin\nthat is now reported by the CameraHelper class.\n\nIn order to get there, a few things worth describing on the design of\nthe series.\n\nAlong the whole series, I tried to separate \"sensor\" configuration data\nfrom run-time configuration data. The main target here is to facilitate\nthe work Kieran is doing about centralizing the sensor configuration in\nthe sensorHelper, so that each IPA doesn't have to populate and handle\nthe sensor configuration data.\n\nFor this reason I tried to:\n\n1) Align all IPAS to use the same IPAContext.configuration.sensor layout\n where they populate the sensor configuration data at configure() time\n2) Make the AgcMeanLuminance and ExposureModeHelper class use a similar\n type to:\n - Pass configuration data to AgcMeanLuminance::configure()\n - Store the configuration data separately from the run-time data in\n ExposureModeHelper\n\n I'm not thrilled by adding more types, one per each class, but\n hopefully this should make it easy to replace all of them by just\n using the camera sensor helper\n\nAs the AgcMeanLuminance algorithm tries to push the exposure time up\nto the maximum allowed frame duration, initializing the algorithm\nwith the sensor's maximum capabilities results in a very low frame rate,\nunless the user specifies a FrameDurationLimits range in which the\nalgorithm should operate. To avoid slowing the frame rate down too much\ncompute a \"default\" frame rate at algorithm configuration time, were\nthe canonical 30, 15 and 10 FPS values are tested and selected in order\nof preference.\n\nI took the occasion to also rework the AgcMeanLuminance interface which\nnow looks like:\n\n- AgcMeanLuminance::configure(sensorConfig, sensorHelper)\n- AgcMeanLuminance::setExposureLimits(fixedShutter, fixedGain, frameDuration)\n\nOnce all IPAs have been moved to compute the exposure time from the\nframe duration, the exposure time can be removed from the sensor\nconfiguration data.\n\nNiklas suggested we should remove inspecting V4L2_CID_EXPOSURE\ncompletely. While I don't 100% agree this is any problem, I tried to do\nso, but the minExposureTime is effectivelly a sensor parameter and if\nthe kernel offers an easy way to retrieve it I think we should use it.\n\nThe last patch is not for inclusion as Mali support needs to be\nfinalized upstream first, but shows how is it possible to handle\nframe duration limits and exposure with the new model (and I needed that\npatch for testing on Mali anyway).\n\nTested with camshark on Mali-C55 and RkISP1 and with a test scripts that\nsets a longer frame duration (66 msecs) and by validating that the\nexposure time is increased to match the new limits on RkISP1.\n\nRkISP1Agc agc.cpp:644 Divided up exposure time, analogue gain, quantization gain and digital gain are 33251.27us, 10.6667, 1.00018 and 6.49639\n61.545331 (47.58 fps) cam0-stream0 seq: 000050 bytesused: 2073600/1036800\nkISP1Agc agc.cpp:644 Divided up exposure time, analogue gain, quantization gain and digital gain are 66578.16us, 10.6667, 1.00018 and 3.24451\n61.566241 (47.82 fps) cam0-stream0 seq: 000051 bytesused: 2073600/1036800\n\nSigned-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n---\nChanges in v3:\n- EDITME: describe what is new in this series revision.\n- EDITME: use bulletpoints and terse descriptions.\n- Link to v2: https://lore.kernel.org/r/20251028-exposure-limits-v2-0-a8b5a318323e@ideasonboard.com\n\nChanges in v2:\n- Rework of v1 that moves the exposure limits computation to the\n AgcMeanLuminance exposure helpers\n\n---\nJacopo Mondi (18):\n ipa: ipu3: Move CameraHelper to context\n ipa: rkisp1: Store FrameDurationLimits as sensor config\n ipa: mali: Move exposure limits to sensor config\n ipa: ipu3: Move exposure limits to sensor config\n ipa: camera_sensor_helper: Introduce maxShutterTime()\n ipa: camera_sensor_helper: Introduce minFrameDuration()\n ipa: libipa: agc: Remove unused accessors\n ipa: libipa: agc: Store sensor configuration parameters\n ipa: libipa: agc: Make Agc::configure() set limits\n ipa: libipa: agc: Pass the frame duration to configure()\n ipa: libipa: agc: Compute max shutter time with frame duration\n ipa: libipa: agc: Calculate exposure limits with frame duration\n ipa: libipa: agc: Rework setLimits() interface\n ipa: libipa: agc: Fold resetFrameCount() in configure()\n ipa: libipa: Remove maxExposureTime from sensor configuration\n ipa: rkisp1: agc: Calculate frame duration using cam helper\n ipa: libipa: agc: Initialize a sensible frame duration\n [DNI] ipa: mali: Handle FrameDurationLimits\n\nKieran Bingham (1):\n ipa: mali-c55: Move CameraHelper to context\n\n src/ipa/ipu3/algorithms/agc.cpp | 29 +++----\n src/ipa/ipu3/algorithms/agc.h | 4 -\n src/ipa/ipu3/ipa_context.cpp | 29 +++----\n src/ipa/ipu3/ipa_context.h | 17 ++--\n src/ipa/ipu3/ipu3.cpp | 37 ++++----\n src/ipa/libipa/agc_mean_luminance.cpp | 127 ++++++++++++++++++++-------\n src/ipa/libipa/agc_mean_luminance.h | 27 ++++--\n src/ipa/libipa/camera_sensor_helper.cpp | 113 ++++++++++++++++++++++++\n src/ipa/libipa/camera_sensor_helper.h | 6 ++\n src/ipa/libipa/exposure_mode_helper.cpp | 148 +++++++++++++++++++++-----------\n src/ipa/libipa/exposure_mode_helper.h | 36 +++++---\n src/ipa/mali-c55/algorithms/agc.cpp | 73 +++++++++++++---\n src/ipa/mali-c55/ipa_context.cpp | 6 ++\n src/ipa/mali-c55/ipa_context.h | 21 ++++-\n src/ipa/mali-c55/mali-c55.cpp | 55 ++++++------\n src/ipa/rkisp1/algorithms/agc.cpp | 92 +++++++++-----------\n src/ipa/rkisp1/ipa_context.cpp | 3 -\n src/ipa/rkisp1/ipa_context.h | 3 +-\n src/ipa/rkisp1/rkisp1.cpp | 45 ++++++----\n 19 files changed, 598 insertions(+), 273 deletions(-)\n---\nbase-commit: 6d19c813b0a74770165e032e7f527c36b838e456\nchange-id: 20251017-exposure-limits-5c48252fe548\n\nBest regards," }