{"id":21471,"url":"https://patchwork.libcamera.org/api/covers/21471/?format=json","web_url":"https://patchwork.libcamera.org/cover/21471/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/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":"<20241002161933.247091-1-stefan.klug@ideasonboard.com>","date":"2024-10-02T16:19:18","name":"[v1,0/8] Add support for IPA debugging metadata","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/people/184/?format=json","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/cover/21471/mbox/","series":[{"id":4648,"url":"https://patchwork.libcamera.org/api/series/4648/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4648","date":"2024-10-02T16:19:18","name":"Add support for IPA debugging metadata","version":1,"mbox":"https://patchwork.libcamera.org/series/4648/mbox/"}],"comments":"https://patchwork.libcamera.org/api/covers/21471/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 E64ACBD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  2 Oct 2024 16:20:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 32D7663525;\n\tWed,  2 Oct 2024 18:20:07 +0200 (CEST)","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 9404063510\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  2 Oct 2024 18:20:04 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:b246:b33f:c662:8ae1])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 963573EA;\n\tWed,  2 Oct 2024 18:18:31 +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=\"hYsb/RXO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1727885911;\n\tbh=JLPIi/ZcdUPUZ7ExAvdMEkmPBTkVpD2dcttxv3Mz+jM=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=hYsb/RXOQlxcL9rpTCXQKpzEd25RKQPGIpGCSn+My91e37N/PefVsxEvpGuzEpP2x\n\tAF7cfb3S0HchvjmuFKVc2EtUv7HWNk0y8M0/CVJM8njnrTkuMyzbP0edZIKtHx/3z8\n\tnRyygJ1BrBNcEgxDGHD1OExKy9Q6ZeE1MyZTtOBI=","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","Subject":"[PATCH v1 0/8] Add support for IPA debugging metadata","Date":"Wed,  2 Oct 2024 18:19:18 +0200","Message-ID":"<20241002161933.247091-1-stefan.klug@ideasonboard.com>","X-Mailer":"git-send-email 2.43.0","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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":"To easily debug the algorithms of a running IPA it is necessary to\ninspect live data. Three options where discussed on how to make that\nprocess easier:\n\n1. Tracing using lttng: We already have a bit infrastructure for that.\nNevertheless the setup is a bit more involved and there is no code\navailable (yet) to digest the live data. Adding new tracepoints also\nrequires modifications at multiple places.\n\n2. Extending the metadata infrastructure: We already have good\ninfrastructure for metadata handling. Tooling around libcamera (like\ncamshark) already have good support for metadata. The downside of\nmetadata might be the limited efficiency on the way from the ipa to the\nuser involving (possibly) inefficient serializations and copies.\n\n3. Adding a completely new infrastructure for debug metadata and\nseperate interfaces on the API.\n\nThis series implements the tooling for option 2 (add debug metadata).\nOption 1 will also be investigated further, but seems to be better\nfitted to performance issues than to algorithmic issue.  Option 3 was\nnot investigated further due to the involved effort and the unclear\nneeds on the overall process.\n\nPatches 1-3 add some infrastructure to make the process easier.\n\nPatches 4 and 6 are tiny fixups.\n\nPatch 5 adds debug metadata support to the rkisp1 IPA.\n\nPatch 7 adds actual debug entries to the agc algorithm in the rkisp1.\n\nThe whole series works in companion with the new graph display in\ncamhsark, that is available in the current master of camshark (\nhttps://gitlab.freedesktop.org/camera/camshark )\n\nBest regards,\nStefan\n\n\n\nStefan Klug (8):\n  libcamera: Add debug control space\n  libcamera: Add a DebugMetadata helper\n  utils: Add script to generate control_ids_debug.yaml\n  ipa: rkisp1: Add constructor to the ipa context\n  ipa: rkisp1: Add debug metadata support to the rkisp1\n  ipa: libipa: Add data accessor to Histogram\n  [WIP] ipa: Add debug controls to the agc algorithm\n  [WIP] ipa: enable debug metadata by default\n\n include/libcamera/internal/debug_controls.h |  52 +++++++\n include/libcamera/internal/meson.build      |   1 +\n include/libcamera/meson.build               |   3 +-\n src/ipa/libipa/agc_mean_luminance.cpp       |   8 +\n src/ipa/libipa/agc_mean_luminance.h         |   4 +\n src/ipa/libipa/histogram.cpp                |   6 +\n src/ipa/libipa/histogram.h                  |   1 +\n src/ipa/rkisp1/algorithms/agc.cpp           |   8 +\n src/ipa/rkisp1/ipa_context.h                |  10 ++\n src/ipa/rkisp1/rkisp1.cpp                   |  11 +-\n src/libcamera/control_ids_core.yaml         |   6 +\n src/libcamera/control_ids_debug.yaml        |  26 ++++\n src/libcamera/control_ranges.yaml           |   5 +-\n src/libcamera/debug_controls.cpp            | 144 +++++++++++++++++\n src/libcamera/meson.build                   |   1 +\n utils/gen-debug-controls.py                 | 161 ++++++++++++++++++++\n 16 files changed, 444 insertions(+), 3 deletions(-)\n create mode 100644 include/libcamera/internal/debug_controls.h\n create mode 100644 src/libcamera/control_ids_debug.yaml\n create mode 100644 src/libcamera/debug_controls.cpp\n create mode 100755 utils/gen-debug-controls.py"}