{"id":13731,"url":"https://patchwork.libcamera.org/api/1.1/covers/13731/?format=json","web_url":"https://patchwork.libcamera.org/cover/13731/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210907194107.803730-1-jacopo@jmondi.org>","date":"2021-09-07T19:40:50","name":"[libcamera-devel,v2,00/17] IPU3 control info update and HAL frame durations","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/1.1/people/3/?format=json","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"mbox":"https://patchwork.libcamera.org/cover/13731/mbox/","series":[{"id":2492,"url":"https://patchwork.libcamera.org/api/1.1/series/2492/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2492","date":"2021-09-07T19:40:50","name":"IPU3 control info update and HAL frame durations","version":2,"mbox":"https://patchwork.libcamera.org/series/2492/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/13731/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 1B951BDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  7 Sep 2021 19:40:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4C39A6916C;\n\tTue,  7 Sep 2021 21:40:28 +0200 (CEST)","from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 740DB60251\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  7 Sep 2021 21:40:27 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id EEA36240004;\n\tTue,  7 Sep 2021 19:40:26 +0000 (UTC)"],"From":"Jacopo Mondi <jacopo@jmondi.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue,  7 Sep 2021 21:40:50 +0200","Message-Id":"<20210907194107.803730-1-jacopo@jmondi.org>","X-Mailer":"git-send-email 2.32.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v2 00/17] IPU3 control info update and HAL\n\tframe durations","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":"As the patch subject suggests, this series is composed of two main parts, which\nconcur in correctly handling the frame durations reported to the Android HAL.\n\nThe series starts by allowing the IPU3 pipeline handler to select the optimal\nsensor size to feed the ImgU with. Umang's series is a requirement for this\npatch, otherwise the ImgU configuration fails.\n\nPatches 2 and 3 update the Camera's ControlInfoMap in response to a\nCamera::configure() call, by updating the controls limits in the ph and the IPA.\n\nFrom patch 4 on the Android HAL parts begins by collecting per-stream frame\ndurations. As the frame durations are updated as part of the Camera's\nControlInfoMap limits update it is necessary to configure the camera during the\nHAL startup. A few cleanup patches follows, including the correct handling of\nSTALL durations\n\nPatch 10 introduces a filtering criteria for YUV streams: only streams that can\nproduce 30 FPS can be registered for preview. I was not able to find this\nclearly specified in documentation but the requirement has been confirmed by the\ncros camera team and in the Intel HAL implementation.\n\nAfter two more cleanup patches the way\nANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES gets populated is changed to\ncomply with the documentation. Note that this does not align with the Intel HAL\nimplementation which registers 8 values instead of 4.\n\nThe last part of the series is there mostly for comments.\nThe idea is that streams capable of running at more than 30 FPS should be\nlimited to such frame rate, as it has proven to be the optimal one for the\nplatform, and including more frame rates (in example ov5670 is capable of 60FPS\nat smaller resolutions) would require a different handling of\nANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES which I've not been able to fully\nclarify yet.\n\nAs a confirmation, the Intel HAL limits all its streams to 30 FPS as well for\nIQ optimization reasons.\n\nThe series contains one patch to limit the reported duration to 30 FPS and\nplease CTS without actually limiting the frame rate.\nThe patch is then reverted and the same mechanism is implemented in the IPA,\nthis time actually setting the right vblank to maintain the 30 FPS frame rate\n(confirmed inspecting timestamps reported by 'cam').\n\nWith both solutions applied I got several 0 failures CTS runs. With the HAL-only\nsolution the flaky recording tests failed once, with the IPA solution I got not\nfailures in 3 CTS runs.\n\nv1->v2:\n- add a patch to centralize the ImgU sizes definition\n- small grammar/spelling fixes here and there\n- Collect the actual minFPS when populating AE_AVAILABLE_FPS_RANGE instead of\n  limiting it to 15, as suggested by Paul.\n\nThanks\n   j\n\nJacopo Mondi (17):\n  libcamera: ipu3: Use the optimal sensor size\n  libcamera: ipu3: Centralize ImgU sizes definition\n  libcamera: ipu3: Split controls init/update\n  ipa: ipu3: Update camera controls in configure()\n  android: capabilities: Collect per-stream frame durations\n  android: capabilities: Initialize camera state when building\n    properties\n  android: capabilties: Assume controls::FrameDurationLimits is\n    supported\n  android: capabilities: Use per-configuration durations\n  android: capabilties: Correctly populate STALL durations\n  android: capabilities: Collect absolute max frame durations\n  android: Filter preview streams on FPS\n  android: capabilities: Print output stream list\n  android: Populate streams and duration in the same loop\n  android: capabilties: Fix\n    ANDROID_CONTROL_AE_AVAILABLE_TARGET_FPS_RANGES\n  android: capabilities: Cap frame rate to 30 FPS\n  Revert \"android: capabilities: Cap frame rate to 30 FPS\"\n  ipa: ipu3: Cap frame duration to 30 FPS\n\n include/libcamera/ipa/ipu3.mojom     |   3 +-\n src/android/camera_capabilities.cpp  | 205 +++++++++++++++++----------\n src/android/camera_capabilities.h    |   3 +\n src/ipa/ipu3/ipu3.cpp                | 119 ++++++++++++----\n src/libcamera/pipeline/ipu3/imgu.cpp |  86 +++++------\n src/libcamera/pipeline/ipu3/imgu.h   |  27 ++++\n src/libcamera/pipeline/ipu3/ipu3.cpp | 119 ++++++++++------\n 7 files changed, 357 insertions(+), 205 deletions(-)\n\n--\n2.32.0"}