[{"id":29233,"web_url":"https://patchwork.libcamera.org/comment/29233/","msgid":"<171327215175.2468918.9737559770746719005@ping.linuxembedded.co.uk>","date":"2024-04-16T12:55:51","subject":"Re: [PATCH v8 00/18] libcamera: introduce Software ISP and Software\n\tIPA","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Milan,\n\nQuoting Milan Zamazal (2024-04-16 10:13:36)\n> Here is v8 of the patch-set to add Software ISP support\n> to libcamera / to the simple pipeline-handler.\n\nThank you for all this work updating here.\n\nI've triggered the tests to run at\nhttps://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1155543.\n\nThere is one failure (don't panic) on debian:10. But I beleive that's\nbecause Debian:10 apt repositories have moved to archive, and so we'll\nneed to update our container builds.\n\nTo compensate for this, I've also run through my old integration build\nmatrix which still passed.\n\nAs such I believe we're ready to merge this series \\o/\n\nAnd as this is what I was holding off for to tag libcamera-0.3 - I think\nthat means a release is imminent, except that I'm very overloaded and\ndon't have much time this week ;-)\n\n--\nKieran\n\n\n> \n> Changes in v8 vs v7:\n> - Doc fixes in dma_heaps.cpp.\n> - SharedMemObject::size -> SharedMemObject::kSize\n>   (+ commit message expanded as suggested by Kieran).\n> - My commit messages limited to the line length of 72.\n> - All commit messages capitalized\n>   (for consistency both within the branch and with other libcamera\n>   commits).\n> - Using Span directly rather than defining SharedMem::span.\n> - Minor code changes in shared_mem_object.cpp as suggested by Laurent.\n> - Forgotten use of a type alias added in black_level.h\n>   (+ the type name capitalized).\n> - Rebased on current master.\n> - The dummy parameter dropped from setIspParams.\n> \n> git branch for this v8 patch set:\n> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v11\n> CI pipeline:\n> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/pipelines/1154685\n> (The debian10 failure looks unrelated.)\n> \n> Changes in v7 vs v6:\n> Laurent's comments addressed, most notably:\n> * Formatting changes.\n> * Docstrings moved from *.h to *.cpp files.\n> * Improvements of docstrings.\n> * Miscellaneous refactorings without changing the code itself.\n> * Added src/libcamera/software_isp/TODO.\n> * Variables renamed:\n>   - DmaHeapFlag flag -> type\n>   - DmaHeapInfo.name -> deviceNodeName\n>   - generally renames to snakeCase where applicable\n> * DmaHeap no longer officially prefers CMA heap.\n> * SharedMem::mem_ is a Span now and private; size_ dropped.\n> * SharedMemObject template is limited to standard layout objects now.\n> * A more specific #include used in soft_simple.cpp.\n> * DebayerCpu::setDebayerFunctions no longer uses goto.\n> * The benchmarking document reformated to 80 columns.\n> * CameraSensorHelper patch integrated into preceding patches.\n> \n> git branch for this v7 patch set:\n> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v10\n> CI pipeline:\n> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/pipelines/1145462\n> \n> Changes in v6 vs v5:\n> - [06/18] libcamera: software_isp: Add SwStatsCpu class\n>   Resolved a rebase conflict in meson.build.\n> - [16/18] libcamera: Add \"Software ISP benchmarking\"\n>   Fixed a trivial typo (Stefan).\n> - [17/18] libcamera: software_isp: Apply black level compensation\n>   A comment style adjusted (Kieran).\n>   A common value extracted into a variable.\n> \n> git branch for this v6 patch set:\n> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v09\n> \n> Changes in v5 vs v4:\n> - CI fully passes now!\n> - Fix some small typos / using unnamed const values pointed\n>   out in Milan's reviews\n> \n> Since there have been no significant review comments on v4\n> and since this fully passes CI now I believe that this version\n> is ready for merging.\n> \n> git branch for this v5 patch set:\n> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v08-for-ci\n> \n> Older changelogs and links to git branches:\n> \n> Changes in v4 vs v3:\n> - Andrey:\n>   [05/18] \"libcamera: shared_mem_object: reorganize the code and document the SharedMemObject class\"\n>   - documentation fixes\n>   [09/18] \"libcamera: ipa: add Soft IPA\"\n>   - Use int32_t for again*_ and exposure*_ as this matches\n>     the value the corresponding ControlValue::get() returns\n>   - Check for mmap() returning MAP_FAILED on error\n>   - Drop std::move() called on const SharedFD & argument\n>   - Replace #defines (EXPOSURE_OPTIMAL_VALUE etc) with const expressions\n>   - Use std::clamp() to keep exposure_ and again_ between the *_min_ and\n>     the *_max_\n>   - add comment on non-linear gain value vs gain code\n>   [10/18] \"libcamera: introduce SoftwareIsp\"\n>   - Fix the check of if sharedParams_ were created OK\n>   new [18/18] \"libcamera: Soft IPA: use CameraSensorHelper for analogue gain\"\n>   - One can check if his camera sensor has the CameraSensorHelper implemented with something\n>     like 'grep ^REGISTER_CAMERA_SENSOR_HELPER src/ipa/libipa/camera_sensor_helper.cpp'. If\n>     the camera sensor used has no CameraSensorHelper, the Soft IPA works as before this patch.\n>     This fallback option doesn't make the code nicer, and makes it harder to change the AE/AGC\n>     algorithm to work faster, but I decided to keep it for now.\n> - Milan:\n>   [17/18] \"libcamera: software_isp: Apply black level compensation\"\n>   - New patch adding black-level compensation autmatically detecting the\n>     sensor blacklevel\n> - Hans:\n>   - Small typo changes in various comments/docs\n>   - Replace typedef-s with using\n> \n> Changes in v3 vs v2:\n> - The Software ISP now is always build when building the simple pipeline\n>   handler, no more -Dpipelines=simple/simple. Instead whether the SoftISP\n>   is used or not is based on the media-controller driver. For now it is\n>   only enabled for the \"qcom-camss\" driver (Andrey)\n> - SoftISP factory has been removed, there is a just a single SoftwareISP class now\n> - Fix the multi-threading issues (Andrey)\n> - Fully document the SharedMemObject and DmaHeap classes (Andrey)\n> - Drop SwStats base (integrate into SwStatsCpu class)\n> - Move headers for classes only used by the SoftISP into src/libcamera/software_isp\n> - Move SwStats / SwDebayer docs into .cpp and extend it\n> - Rename many foo_bar symbols to fooBar\n> - Add constexpr kFooBar values for varies hardcoded sizes like\n>   the yHistoGram having 16 bins and the gammalookuptable having 1024 entries\n> - Make startFrame() and finishFrame() normal methods instead of\n>   using function pointers for these\n> - Document how/why an array of src pointers is passed to\n>   the debayer functions\n> - 12bpp unpacked raw bayer input support (Kieran)\n> - Add \"Software ISP benchmarking\" doc\n> \n> Changes in v2 vs v1:\n> - Integrated Dennis, Martti and Toon's auto-exposure algorithm\n>   based on the paper which they found which gives us a nice\n>   relatively simple AEC + AGC algorithm\n>   TODO: Add link to paper to source + commit-message\n> - Integrated Dennis' doxygen comments for all new classes, no more warnings!\n> - Move AWB gain calculations to the IPA (Andrey)\n> - Added 8 bpp and 10 bpp unpacked raw bayer input support (Hans)\n> - Use dma-buf for the output FrameBuffer-s (Andrey)\n> - Memcpy data from input FrameBuffers to a heap buffer on a line by line\n>   basis to speedup debayering from uncached mem (Hans)\n> - This addresses all \"open issues\" from the v1 posting\n> \n> Changes in v1 vs RFC-v2:\n> - Add and use SwStats[Cpu] and Debayer[Cpu] classes\n> - Rename linaro soft-IPA and soft-ISP implementations to simple following\n>   the simple pipeline hander\n> - Integrate Pavel's swstats and debayer improvements\n> \n> This has been tested on:\n> - Qualcomm RB5 board with a mezzanine board equipped with RPi camera v2 (Andrey)\n> - Lenovo x13s, sc8280xp (Bryan)\n> - Pinephone (Pavel)\n> - Debix Model A (Milan)\n> - Lenovo Thinkpad Yoga X1 yoga gen7/8, Alder Lake/Raptor Lake IPU6EP +\n>   ov2740 10bpp packed + unpacked (Dennis / Hans)\n> - Dell Latitude 9420, Tiger Lake IPU6 + ov01a1s (RGBI) sensor\n>   (Martti, requires IGIG_GBGR_IGIG_GRGB patches on top)\n> \n> git branch for v4 of the patch set:\n> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v07\n> \n> git branch for v3 of the patch set:\n> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v06\n> \n> git branch for v2 of the patch set:\n> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v05\n> \n> git branch for v1 of the patch set:\n> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v04\n> \n> Andrei Konovalov (1):\n>   libcamera: shared_mem_object: Reorganize the code and document the\n>     SharedMemObject class\n> \n> Andrey Konovalov (8):\n>   libcamera: pipeline: simple: fix size adjustment in validate()\n>   libcamera: internal: Move dma_heaps.[h, cpp] to common directories\n>   libcamera: dma_heaps: extend DmaHeap class to support system heap\n>   libcamera: internal: Move SharedMemObject class to a common directory\n>   libcamera: ipa: Add Soft IPA\n>   libcamera: Introduce SoftwareIsp\n>   libcamera: pipeline: simple: Rename converterBuffers_ and related vars\n>   libcamera: pipeline: simple: Enable use of Soft ISP and Soft IPA\n> \n> Hans de Goede (7):\n>   libcamera: software_isp: Add SwStatsCpu class\n>   libcamera: software_isp: Add Debayer base class\n>   libcamera: software_isp: Add DebayerCpu class\n>   libcamera: swstats_cpu: Add support for 8, 10 and 12 bpp unpacked\n>     bayer input\n>   libcamera: debayer_cpu: Add support for 8, 10 and 12 bpp unpacked\n>     bayer input\n>   libcamera: debayer_cpu: Add BGR888 output support\n>   libcamera: Add \"Software ISP benchmarking\" documentation\n> \n> Milan Zamazal (2):\n>   libcamera: shared_mem_object: Rename SIZE constant to `size'\n>   libcamera: software_isp: Apply black level compensation\n> \n>  Documentation/Doxyfile.in                     |   1 +\n>  Documentation/index.rst                       |   1 +\n>  Documentation/meson.build                     |   1 +\n>  Documentation/software-isp-benchmarking.rst   |  77 ++\n>  .../libcamera/internal}/dma_heaps.h           |  14 +-\n>  include/libcamera/internal/meson.build        |   3 +\n>  .../libcamera/internal/shared_mem_object.h    | 127 +++\n>  .../internal/software_isp/debayer_params.h    |  29 +\n>  .../internal/software_isp/meson.build         |   7 +\n>  .../internal/software_isp/software_isp.h      |  99 +++\n>  .../internal/software_isp/swisp_stats.h       |  49 ++\n>  include/libcamera/ipa/meson.build             |   1 +\n>  include/libcamera/ipa/soft.mojom              |  28 +\n>  meson_options.txt                             |   2 +-\n>  src/ipa/meson.build                           |   3 +\n>  src/ipa/simple/black_level.cpp                |  88 ++\n>  src/ipa/simple/black_level.h                  |  28 +\n>  src/ipa/simple/data/meson.build               |  10 +\n>  src/ipa/simple/data/uncalibrated.yaml         |   5 +\n>  src/ipa/simple/meson.build                    |  30 +\n>  src/ipa/simple/soft_simple.cpp                | 403 +++++++++\n>  src/libcamera/dma_heaps.cpp                   | 165 ++++\n>  src/libcamera/meson.build                     |   3 +\n>  .../pipeline/rpi/common/shared_mem_object.h   | 128 ---\n>  src/libcamera/pipeline/rpi/vc4/dma_heaps.cpp  |  90 --\n>  src/libcamera/pipeline/rpi/vc4/meson.build    |   1 -\n>  src/libcamera/pipeline/rpi/vc4/vc4.cpp        |   5 +-\n>  src/libcamera/pipeline/simple/simple.cpp      | 241 ++++--\n>  src/libcamera/shared_mem_object.cpp           | 236 +++++\n>  src/libcamera/software_isp/TODO               | 279 ++++++\n>  src/libcamera/software_isp/debayer.cpp        | 132 +++\n>  src/libcamera/software_isp/debayer.h          |  54 ++\n>  src/libcamera/software_isp/debayer_cpu.cpp    | 807 ++++++++++++++++++\n>  src/libcamera/software_isp/debayer_cpu.h      | 158 ++++\n>  src/libcamera/software_isp/meson.build        |  15 +\n>  src/libcamera/software_isp/software_isp.cpp   | 357 ++++++++\n>  src/libcamera/software_isp/swstats_cpu.cpp    | 432 ++++++++++\n>  src/libcamera/software_isp/swstats_cpu.h      |  97 +++\n>  38 files changed, 3922 insertions(+), 284 deletions(-)\n>  create mode 100644 Documentation/software-isp-benchmarking.rst\n>  rename {src/libcamera/pipeline/rpi/vc4 => include/libcamera/internal}/dma_heaps.h (65%)\n>  create mode 100644 include/libcamera/internal/shared_mem_object.h\n>  create mode 100644 include/libcamera/internal/software_isp/debayer_params.h\n>  create mode 100644 include/libcamera/internal/software_isp/meson.build\n>  create mode 100644 include/libcamera/internal/software_isp/software_isp.h\n>  create mode 100644 include/libcamera/internal/software_isp/swisp_stats.h\n>  create mode 100644 include/libcamera/ipa/soft.mojom\n>  create mode 100644 src/ipa/simple/black_level.cpp\n>  create mode 100644 src/ipa/simple/black_level.h\n>  create mode 100644 src/ipa/simple/data/meson.build\n>  create mode 100644 src/ipa/simple/data/uncalibrated.yaml\n>  create mode 100644 src/ipa/simple/meson.build\n>  create mode 100644 src/ipa/simple/soft_simple.cpp\n>  create mode 100644 src/libcamera/dma_heaps.cpp\n>  delete mode 100644 src/libcamera/pipeline/rpi/common/shared_mem_object.h\n>  delete mode 100644 src/libcamera/pipeline/rpi/vc4/dma_heaps.cpp\n>  create mode 100644 src/libcamera/shared_mem_object.cpp\n>  create mode 100644 src/libcamera/software_isp/TODO\n>  create mode 100644 src/libcamera/software_isp/debayer.cpp\n>  create mode 100644 src/libcamera/software_isp/debayer.h\n>  create mode 100644 src/libcamera/software_isp/debayer_cpu.cpp\n>  create mode 100644 src/libcamera/software_isp/debayer_cpu.h\n>  create mode 100644 src/libcamera/software_isp/meson.build\n>  create mode 100644 src/libcamera/software_isp/software_isp.cpp\n>  create mode 100644 src/libcamera/software_isp/swstats_cpu.cpp\n>  create mode 100644 src/libcamera/software_isp/swstats_cpu.h\n> \n> -- \n> 2.42.0\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 A5D9ABE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 16 Apr 2024 12:55:58 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EB0A063352;\n\tTue, 16 Apr 2024 14:55:56 +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 EE42461B75\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2024 14:55:54 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 50EA59A8;\n\tTue, 16 Apr 2024 14:55:08 +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=\"T8KN1tIY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1713272108;\n\tbh=y2XdXVB2zcCS0YolbjYckp7OlwLN80D5SGjrfI/HDHY=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=T8KN1tIYAJd/j7UUkEIatgqLBXjJtBkMesqFr1IoD9MiT826LYFnUBHGzdIBuiNzh\n\tWdeMNI2GlleDvcVA5ZCIqUJM8Hch2YORd8umDEuGNnnTQkvsbkpx2Zg1hR/95biElw\n\tbdQbw9oGZOklJAu7dB+VI2B42Q1S2yqPM2FCMD9A=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20240416091357.211951-1-mzamazal@redhat.com>","References":"<20240416091357.211951-1-mzamazal@redhat.com>","Subject":"Re: [PATCH v8 00/18] libcamera: introduce Software ISP and Software\n\tIPA","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Milan Zamazal <mzamazal@redhat.com>,\n\tAndrei Konovalov <andrey.konovalov.ynk@gmail.com>,\n\tBryan O'Donoghue <bryan.odonoghue@linaro.org>,\n\tMaxime Ripard <mripard@redhat.com>, Pavel Machek <pavel@ucw.cz>,\n\tHans de Goede <hdegoede@redhat.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Milan Zamazal <mzamazal@redhat.com>, libcamera-devel@lists.libcamera.org","Date":"Tue, 16 Apr 2024 13:55:51 +0100","Message-ID":"<171327215175.2468918.9737559770746719005@ping.linuxembedded.co.uk>","User-Agent":"alot/0.10","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":29237,"web_url":"https://patchwork.libcamera.org/comment/29237/","msgid":"<87le5djp2r.fsf@redhat.com>","date":"2024-04-16T15:37:48","subject":"Re: [PATCH v8 00/18] libcamera: introduce Software ISP and Software\n\tIPA","submitter":{"id":177,"url":"https://patchwork.libcamera.org/api/people/177/","name":"Milan Zamazal","email":"mzamazal@redhat.com"},"content":"Kieran Bingham <kieran.bingham@ideasonboard.com> writes:\n\n> Hi Milan,\n>\n> Quoting Milan Zamazal (2024-04-16 10:13:36)\n>> Here is v8 of the patch-set to add Software ISP support\n>> to libcamera / to the simple pipeline-handler.\n>\n> Thank you for all this work updating here.\n>\n> I've triggered the tests to run at\n> https://gitlab.freedesktop.org/camera/libcamera/-/pipelines/1155543.\n>\n> There is one failure (don't panic) on debian:10. But I beleive that's\n> because Debian:10 apt repositories have moved to archive, and so we'll\n> need to update our container builds.\n>\n> To compensate for this, I've also run through my old integration build\n> matrix which still passed.\n\nHi Kieran,\n\nthank you for testing.  I noticed the debian10 failure too (it has been\nmentioned, not very prominently, a bit more below).\n\n> As such I believe we're ready to merge this series \\o/\n>\n> And as this is what I was holding off for to tag libcamera-0.3 - I think\n> that means a release is imminent, except that I'm very overloaded and\n> don't have much time this week ;-)\n\nCool, looking forward both. :-)\n\nRegards,\nMilan\n\n> --\n> Kieran\n>\n>\n>> \n>> Changes in v8 vs v7:\n>> - Doc fixes in dma_heaps.cpp.\n>> - SharedMemObject::size -> SharedMemObject::kSize\n>>   (+ commit message expanded as suggested by Kieran).\n>> - My commit messages limited to the line length of 72.\n>> - All commit messages capitalized\n>>   (for consistency both within the branch and with other libcamera\n>>   commits).\n>> - Using Span directly rather than defining SharedMem::span.\n>> - Minor code changes in shared_mem_object.cpp as suggested by Laurent.\n>> - Forgotten use of a type alias added in black_level.h\n>>   (+ the type name capitalized).\n>> - Rebased on current master.\n>> - The dummy parameter dropped from setIspParams.\n>> \n>> git branch for this v8 patch set:\n>> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v11\n>> CI pipeline:\n>> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/pipelines/1154685\n>> (The debian10 failure looks unrelated.)\n>> \n>> Changes in v7 vs v6:\n>> Laurent's comments addressed, most notably:\n>> * Formatting changes.\n>> * Docstrings moved from *.h to *.cpp files.\n>> * Improvements of docstrings.\n>> * Miscellaneous refactorings without changing the code itself.\n>> * Added src/libcamera/software_isp/TODO.\n>> * Variables renamed:\n>>   - DmaHeapFlag flag -> type\n>>   - DmaHeapInfo.name -> deviceNodeName\n>>   - generally renames to snakeCase where applicable\n>> * DmaHeap no longer officially prefers CMA heap.\n>> * SharedMem::mem_ is a Span now and private; size_ dropped.\n>> * SharedMemObject template is limited to standard layout objects now.\n>> * A more specific #include used in soft_simple.cpp.\n>> * DebayerCpu::setDebayerFunctions no longer uses goto.\n>> * The benchmarking document reformated to 80 columns.\n>> * CameraSensorHelper patch integrated into preceding patches.\n>> \n>> git branch for this v7 patch set:\n>> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v10\n>> CI pipeline:\n>> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/pipelines/1145462\n>> \n>> Changes in v6 vs v5:\n>> - [06/18] libcamera: software_isp: Add SwStatsCpu class\n>>   Resolved a rebase conflict in meson.build.\n>> - [16/18] libcamera: Add \"Software ISP benchmarking\"\n>>   Fixed a trivial typo (Stefan).\n>> - [17/18] libcamera: software_isp: Apply black level compensation\n>>   A comment style adjusted (Kieran).\n>>   A common value extracted into a variable.\n>> \n>> git branch for this v6 patch set:\n>> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v09\n>> \n>> Changes in v5 vs v4:\n>> - CI fully passes now!\n>> - Fix some small typos / using unnamed const values pointed\n>>   out in Milan's reviews\n>> \n>> Since there have been no significant review comments on v4\n>> and since this fully passes CI now I believe that this version\n>> is ready for merging.\n>> \n>> git branch for this v5 patch set:\n>> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v08-for-ci\n>> \n>> Older changelogs and links to git branches:\n>> \n>> Changes in v4 vs v3:\n>> - Andrey:\n>>   [05/18] \"libcamera: shared_mem_object: reorganize the code and document the SharedMemObject class\"\n>>   - documentation fixes\n>>   [09/18] \"libcamera: ipa: add Soft IPA\"\n>>   - Use int32_t for again*_ and exposure*_ as this matches\n>>     the value the corresponding ControlValue::get() returns\n>>   - Check for mmap() returning MAP_FAILED on error\n>>   - Drop std::move() called on const SharedFD & argument\n>>   - Replace #defines (EXPOSURE_OPTIMAL_VALUE etc) with const expressions\n>>   - Use std::clamp() to keep exposure_ and again_ between the *_min_ and\n>>     the *_max_\n>>   - add comment on non-linear gain value vs gain code\n>>   [10/18] \"libcamera: introduce SoftwareIsp\"\n>>   - Fix the check of if sharedParams_ were created OK\n>>   new [18/18] \"libcamera: Soft IPA: use CameraSensorHelper for analogue gain\"\n>>   - One can check if his camera sensor has the CameraSensorHelper implemented with something\n>>     like 'grep ^REGISTER_CAMERA_SENSOR_HELPER src/ipa/libipa/camera_sensor_helper.cpp'. If\n>>     the camera sensor used has no CameraSensorHelper, the Soft IPA works as before this patch.\n>>     This fallback option doesn't make the code nicer, and makes it harder to change the AE/AGC\n>>     algorithm to work faster, but I decided to keep it for now.\n>> - Milan:\n>>   [17/18] \"libcamera: software_isp: Apply black level compensation\"\n>>   - New patch adding black-level compensation autmatically detecting the\n>>     sensor blacklevel\n>> - Hans:\n>>   - Small typo changes in various comments/docs\n>>   - Replace typedef-s with using\n>> \n>> Changes in v3 vs v2:\n>> - The Software ISP now is always build when building the simple pipeline\n>>   handler, no more -Dpipelines=simple/simple. Instead whether the SoftISP\n>>   is used or not is based on the media-controller driver. For now it is\n>>   only enabled for the \"qcom-camss\" driver (Andrey)\n>> - SoftISP factory has been removed, there is a just a single SoftwareISP class now\n>> - Fix the multi-threading issues (Andrey)\n>> - Fully document the SharedMemObject and DmaHeap classes (Andrey)\n>> - Drop SwStats base (integrate into SwStatsCpu class)\n>> - Move headers for classes only used by the SoftISP into src/libcamera/software_isp\n>> - Move SwStats / SwDebayer docs into .cpp and extend it\n>> - Rename many foo_bar symbols to fooBar\n>> - Add constexpr kFooBar values for varies hardcoded sizes like\n>>   the yHistoGram having 16 bins and the gammalookuptable having 1024 entries\n>> - Make startFrame() and finishFrame() normal methods instead of\n>>   using function pointers for these\n>> - Document how/why an array of src pointers is passed to\n>>   the debayer functions\n>> - 12bpp unpacked raw bayer input support (Kieran)\n>> - Add \"Software ISP benchmarking\" doc\n>> \n>> Changes in v2 vs v1:\n>> - Integrated Dennis, Martti and Toon's auto-exposure algorithm\n>>   based on the paper which they found which gives us a nice\n>>   relatively simple AEC + AGC algorithm\n>>   TODO: Add link to paper to source + commit-message\n>> - Integrated Dennis' doxygen comments for all new classes, no more warnings!\n>> - Move AWB gain calculations to the IPA (Andrey)\n>> - Added 8 bpp and 10 bpp unpacked raw bayer input support (Hans)\n>> - Use dma-buf for the output FrameBuffer-s (Andrey)\n>> - Memcpy data from input FrameBuffers to a heap buffer on a line by line\n>>   basis to speedup debayering from uncached mem (Hans)\n>> - This addresses all \"open issues\" from the v1 posting\n>> \n>> Changes in v1 vs RFC-v2:\n>> - Add and use SwStats[Cpu] and Debayer[Cpu] classes\n>> - Rename linaro soft-IPA and soft-ISP implementations to simple following\n>>   the simple pipeline hander\n>> - Integrate Pavel's swstats and debayer improvements\n>> \n>> This has been tested on:\n>> - Qualcomm RB5 board with a mezzanine board equipped with RPi camera v2 (Andrey)\n>> - Lenovo x13s, sc8280xp (Bryan)\n>> - Pinephone (Pavel)\n>> - Debix Model A (Milan)\n>> - Lenovo Thinkpad Yoga X1 yoga gen7/8, Alder Lake/Raptor Lake IPU6EP +\n>>   ov2740 10bpp packed + unpacked (Dennis / Hans)\n>> - Dell Latitude 9420, Tiger Lake IPU6 + ov01a1s (RGBI) sensor\n>>   (Martti, requires IGIG_GBGR_IGIG_GRGB patches on top)\n>> \n>> git branch for v4 of the patch set:\n>> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v07\n>> \n>> git branch for v3 of the patch set:\n>> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v06\n>> \n>> git branch for v2 of the patch set:\n>> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v05\n>> \n>> git branch for v1 of the patch set:\n>> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/SoftwareISP-v04\n>> \n>> Andrei Konovalov (1):\n>>   libcamera: shared_mem_object: Reorganize the code and document the\n>>     SharedMemObject class\n>> \n>> Andrey Konovalov (8):\n>>   libcamera: pipeline: simple: fix size adjustment in validate()\n>>   libcamera: internal: Move dma_heaps.[h, cpp] to common directories\n>>   libcamera: dma_heaps: extend DmaHeap class to support system heap\n>>   libcamera: internal: Move SharedMemObject class to a common directory\n>>   libcamera: ipa: Add Soft IPA\n>>   libcamera: Introduce SoftwareIsp\n>>   libcamera: pipeline: simple: Rename converterBuffers_ and related vars\n>>   libcamera: pipeline: simple: Enable use of Soft ISP and Soft IPA\n>> \n>> Hans de Goede (7):\n>>   libcamera: software_isp: Add SwStatsCpu class\n>>   libcamera: software_isp: Add Debayer base class\n>>   libcamera: software_isp: Add DebayerCpu class\n>>   libcamera: swstats_cpu: Add support for 8, 10 and 12 bpp unpacked\n>>     bayer input\n>>   libcamera: debayer_cpu: Add support for 8, 10 and 12 bpp unpacked\n>>     bayer input\n>>   libcamera: debayer_cpu: Add BGR888 output support\n>>   libcamera: Add \"Software ISP benchmarking\" documentation\n>> \n>> Milan Zamazal (2):\n>>   libcamera: shared_mem_object: Rename SIZE constant to `size'\n>>   libcamera: software_isp: Apply black level compensation\n>> \n>>  Documentation/Doxyfile.in                     |   1 +\n>>  Documentation/index.rst                       |   1 +\n>>  Documentation/meson.build                     |   1 +\n>>  Documentation/software-isp-benchmarking.rst   |  77 ++\n>>  .../libcamera/internal}/dma_heaps.h           |  14 +-\n>>  include/libcamera/internal/meson.build        |   3 +\n>>  .../libcamera/internal/shared_mem_object.h    | 127 +++\n>>  .../internal/software_isp/debayer_params.h    |  29 +\n>>  .../internal/software_isp/meson.build         |   7 +\n>>  .../internal/software_isp/software_isp.h      |  99 +++\n>>  .../internal/software_isp/swisp_stats.h       |  49 ++\n>>  include/libcamera/ipa/meson.build             |   1 +\n>>  include/libcamera/ipa/soft.mojom              |  28 +\n>>  meson_options.txt                             |   2 +-\n>>  src/ipa/meson.build                           |   3 +\n>>  src/ipa/simple/black_level.cpp                |  88 ++\n>>  src/ipa/simple/black_level.h                  |  28 +\n>>  src/ipa/simple/data/meson.build               |  10 +\n>>  src/ipa/simple/data/uncalibrated.yaml         |   5 +\n>>  src/ipa/simple/meson.build                    |  30 +\n>>  src/ipa/simple/soft_simple.cpp                | 403 +++++++++\n>>  src/libcamera/dma_heaps.cpp                   | 165 ++++\n>>  src/libcamera/meson.build                     |   3 +\n>>  .../pipeline/rpi/common/shared_mem_object.h   | 128 ---\n>>  src/libcamera/pipeline/rpi/vc4/dma_heaps.cpp  |  90 --\n>>  src/libcamera/pipeline/rpi/vc4/meson.build    |   1 -\n>>  src/libcamera/pipeline/rpi/vc4/vc4.cpp        |   5 +-\n>>  src/libcamera/pipeline/simple/simple.cpp      | 241 ++++--\n>>  src/libcamera/shared_mem_object.cpp           | 236 +++++\n>>  src/libcamera/software_isp/TODO               | 279 ++++++\n>>  src/libcamera/software_isp/debayer.cpp        | 132 +++\n>>  src/libcamera/software_isp/debayer.h          |  54 ++\n>>  src/libcamera/software_isp/debayer_cpu.cpp    | 807 ++++++++++++++++++\n>>  src/libcamera/software_isp/debayer_cpu.h      | 158 ++++\n>>  src/libcamera/software_isp/meson.build        |  15 +\n>>  src/libcamera/software_isp/software_isp.cpp   | 357 ++++++++\n>>  src/libcamera/software_isp/swstats_cpu.cpp    | 432 ++++++++++\n>>  src/libcamera/software_isp/swstats_cpu.h      |  97 +++\n>>  38 files changed, 3922 insertions(+), 284 deletions(-)\n>>  create mode 100644 Documentation/software-isp-benchmarking.rst\n>>  rename {src/libcamera/pipeline/rpi/vc4 => include/libcamera/internal}/dma_heaps.h (65%)\n>>  create mode 100644 include/libcamera/internal/shared_mem_object.h\n>>  create mode 100644 include/libcamera/internal/software_isp/debayer_params.h\n>>  create mode 100644 include/libcamera/internal/software_isp/meson.build\n>>  create mode 100644 include/libcamera/internal/software_isp/software_isp.h\n>>  create mode 100644 include/libcamera/internal/software_isp/swisp_stats.h\n>>  create mode 100644 include/libcamera/ipa/soft.mojom\n>>  create mode 100644 src/ipa/simple/black_level.cpp\n>>  create mode 100644 src/ipa/simple/black_level.h\n>>  create mode 100644 src/ipa/simple/data/meson.build\n>>  create mode 100644 src/ipa/simple/data/uncalibrated.yaml\n>>  create mode 100644 src/ipa/simple/meson.build\n>>  create mode 100644 src/ipa/simple/soft_simple.cpp\n>>  create mode 100644 src/libcamera/dma_heaps.cpp\n>>  delete mode 100644 src/libcamera/pipeline/rpi/common/shared_mem_object.h\n>>  delete mode 100644 src/libcamera/pipeline/rpi/vc4/dma_heaps.cpp\n>>  create mode 100644 src/libcamera/shared_mem_object.cpp\n>>  create mode 100644 src/libcamera/software_isp/TODO\n>>  create mode 100644 src/libcamera/software_isp/debayer.cpp\n>>  create mode 100644 src/libcamera/software_isp/debayer.h\n>>  create mode 100644 src/libcamera/software_isp/debayer_cpu.cpp\n>>  create mode 100644 src/libcamera/software_isp/debayer_cpu.h\n>>  create mode 100644 src/libcamera/software_isp/meson.build\n>>  create mode 100644 src/libcamera/software_isp/software_isp.cpp\n>>  create mode 100644 src/libcamera/software_isp/swstats_cpu.cpp\n>>  create mode 100644 src/libcamera/software_isp/swstats_cpu.h\n>> \n>> -- \n>> 2.42.0\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 2610ABE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 16 Apr 2024 15:38:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4245C6333F;\n\tTue, 16 Apr 2024 17:38:18 +0200 (CEST)","from us-smtp-delivery-124.mimecast.com\n\t(us-smtp-delivery-124.mimecast.com [170.10.133.124])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 47F376333E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2024 17:38:16 +0200 (CEST)","from mail-wm1-f69.google.com (mail-wm1-f69.google.com\n\t[209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS\n\t(version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id\n\tus-mta-584-ufXrwGfpNASaUYp_92Yaig-1; Tue, 16 Apr 2024 11:38:13 -0400","by mail-wm1-f69.google.com with SMTP id\n\t5b1f17b1804b1-417c5cc7c96so17850215e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Apr 2024 08:38:13 -0700 (PDT)","from nuthatch (ip-77-48-47-2.net.vodafone.cz. [77.48.47.2])\n\tby smtp.gmail.com with ESMTPSA id\n\tdm11-20020a170907948b00b00a51eed4f0d7sm6948928ejc.130.2024.04.16.08.37.48\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 16 Apr 2024 08:37:49 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=redhat.com header.i=@redhat.com\n\theader.b=\"jIksfS75\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n\ts=mimecast20190719; t=1713281895;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=UfMkdTSXbHt3ny1jyWmEksKio3lOg9jVu22ADyZRVE8=;\n\tb=jIksfS75xwgsx7JLEjdgloAhyT6kU42DwSWbw4zjCnLzrPz3Ex+kBweLnyk7C2FpxnkvH3\n\tavXerJGTaqdcf3nTvMteiHKNUcsyGyQxKEBExTmrqRfxQYfenNNmqXtmnnQ0E6PHP+tfJB\n\tehpruLfGhbPgIvMrmRPyfn48Nv7WMhk=","X-MC-Unique":"ufXrwGfpNASaUYp_92Yaig-1","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1713281891; x=1713886691;\n\th=mime-version:user-agent:message-id:date:references:in-reply-to\n\t:subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=UfMkdTSXbHt3ny1jyWmEksKio3lOg9jVu22ADyZRVE8=;\n\tb=pOQoAz5GkB6goH0/Io2WPpL5kaP5ZWyH1Kx89aZZqP2pWih3iUwXdVWylvK/HewW4R\n\tuaPBKsJ2wRMQaXSLivk3ESlli3GOhIJbgGl2LYm+EP94Dhyrz4drgOrPttkYHH2T6Qc2\n\tTNorj1Dge2NAE53SIfyk1yx4Y+9yxkW2mpGELeav3+5F3GuoaaTEn6G0Qu4BH+Tb8h99\n\tM4ZvRoZr0X2vgfKUREDDeEuZPKAhO4gthYewRwLjqGotuDAJgqZFkVuzH1l99ATSDLV+\n\tno7jiUKOumDfVFHGWYR/7IZdxkSUstARgasG2+p2WFivkaGtfkmmBCaWMWenVi4/yERW\n\t2jHA==","X-Gm-Message-State":"AOJu0YxtE/BY96fKz+VN80K9CmTuzkd+L5UhUMgaLVSrZkAetQHQAvWM\n\tzeXamdvVRdte8G+CtRaXwwx8XYWNaJC7R0Ynz27ltAecQSBL/SsSaiGEnyoOUWRHo3eOgfmw0d5\n\tNDDcj4cyBwXeY5DDRg8nvD/qSmzBniFnooA+XjbSTUHv3kaCOKVIuFo5Jgz/wN9UJlcAzmO+qhf\n\tH4C8w=","X-Received":["by 2002:a05:6000:12c6:b0:346:c7ed:22de with SMTP id\n\tl6-20020a05600012c600b00346c7ed22demr8128879wrx.14.1713281890982; \n\tTue, 16 Apr 2024 08:38:10 -0700 (PDT)","by 2002:a17:906:6bcc:b0:a52:4cd9:2dd6 with SMTP id\n\tt12-20020a1709066bcc00b00a524cd92dd6mr6066280ejs.66.1713281870101; \n\tTue, 16 Apr 2024 08:37:50 -0700 (PDT)"],"X-Google-Smtp-Source":"AGHT+IFwytHLq2rtYU6AiAElOLHdQy95vzTkoBLtNaFrdJFUazTN/jpISgsprNTCsd6EGDOKJXCn9g==","From":"Milan Zamazal <mzamazal@redhat.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org,  Andrei Konovalov\n\t<andrey.konovalov.ynk@gmail.com>,  Bryan O'Donoghue\n\t<bryan.odonoghue@linaro.org>, Maxime Ripard <mripard@redhat.com>, Pavel\n\tMachek <pavel@ucw.cz>, Hans de Goede <hdegoede@redhat.com>, Laurent\n\tPinchart <laurent.pinchart@ideasonboard.com>","Subject":"Re: [PATCH v8 00/18] libcamera: introduce Software ISP and Software\n\tIPA","In-Reply-To":"<171327215175.2468918.9737559770746719005@ping.linuxembedded.co.uk>\n\t(Kieran Bingham's message of \"Tue, 16 Apr 2024 13:55:51 +0100\")","References":"<20240416091357.211951-1-mzamazal@redhat.com>\n\t<171327215175.2468918.9737559770746719005@ping.linuxembedded.co.uk>","Date":"Tue, 16 Apr 2024 17:37:48 +0200","Message-ID":"<87le5djp2r.fsf@redhat.com>","User-Agent":"Gnus/5.13 (Gnus v5.13)","MIME-Version":"1.0","X-Mimecast-Spam-Score":"0","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain","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>"}}]