Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New digital gain handling #98

Draft
wants to merge 28 commits into
base: next
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3a5f322
meson: Add libpisp.wrap
naushir May 4, 2023
d8c7750
libcamera: formats: Add 16-bit mono format
naushir Nov 16, 2023
d9bf157
libcamera: formats: Add RGB48 formats
naushir Nov 16, 2023
776d289
libcamera: formats: Add PiSP specific image and config buffer formats
naushir Nov 17, 2022
41dd9b2
ipa: rpi: Add HDR support
naushir Oct 6, 2023
92e9c46
ipa: rpi: Move variables from private to protected
naushir Nov 16, 2023
0bd8810
pipeline: rpi: Add support for Raspberry Pi 5
naushir Jun 19, 2023
d692e23
ipa: rpi: Add support for Raspberry Pi 5
naushir May 4, 2023
bde9e6b
utils: raspberrypi: ctt: Adapt tuning tool for both VC4 and PiSP
davidplowman Mar 17, 2023
aa1bc48
utils: raspberrypi: ctt: Added CAC support to the CTT
bebon901 Aug 25, 2023
52a3b69
utils: raspberrypi: ctt: Changed CTT handling of VC4 and PiSP
bebon901 Sep 4, 2023
b4fee1c
utils: raspberrypi: ctt: Update tuning tool for HDR
davidplowman Oct 6, 2023
3ffe650
RASPBERRYPI ONLY: Add Sony IMX708 sensor properties
njhollinghurst Dec 8, 2022
9601f00
RASPBERRYPI ONLY: Handle mandatory stream flags
naushir May 23, 2023
33ebf6d
RASPBERRYPI ONLY: Add a Github workflow to generate release tarballs
XECDesign Nov 16, 2023
d758394
build: controls: Add Raspberry Pi vendor specific controls
naushir Nov 23, 2023
2c85cc0
ipa: pipeline: implement vendor controls
naushir Dec 1, 2023
430819e
ipa: rpi: black_level: Add an initialValues method
davidplowman Dec 5, 2023
3dca3f1
ipa: rpi: awb: Add an initialValues method
davidplowman Dec 5, 2023
a409bd5
ipa: rpi: pisp: Fetch good colour gain and black level default values
davidplowman Dec 5, 2023
bc33920
ipa: rpi: agc: Change handling of colour gains less than 1
davidplowman Dec 19, 2023
a58644b
ipa: rpi: Advance the delay context counter even when IPAs don't run
davidplowman Dec 15, 2023
0a155fd
ipa: rpi: agc: Make the maximum digital gain configurable
davidplowman Dec 19, 2023
3c89eca
ipa: rpi: agc: Replace analogue gain by (combined) gain
davidplowman Dec 18, 2023
3f9a5a4
ipa: rpi: agc: Calculate digital gain in process()
davidplowman Dec 19, 2023
18af970
ipa: rpi: Update digital gain handling in base class and pisp versions
davidplowman Dec 19, 2023
1d230d0
ipa: rpi: Update digital gain handling for vc4 platform
davidplowman Dec 19, 2023
12b7632
ipa: rpi: agc: Remove digital gain from AgcPrepareStatus
davidplowman Dec 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/gen_orig.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Generate source release tarball
run-name: Generating source release tarball
on:
push:
tags: # vX.Y.Z+rptYYYMMDD
- 'v[0-9]+.[0-9]+.[0-9]+\+rpt[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
workflow_dispatch:
jobs:
publish_tarball:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: | # Local cmake needs to be removed for pybind11 to be detected
sudo rm -rf /usr/local/bin/cmake
sudo apt-get update
sudo apt-get install -y meson pkgconf cmake libgtest-dev libyaml-dev python3 python3-dev pybind11-dev python3-jinja2 python3-ply python3-yaml
- name: Check out repository code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Required for 'git describe' to work
- name: Generate tarball
run: |
meson setup build -Dpycamera=enabled
meson dist --no-tests --include-subprojects -C build
mv build/meson-dist/*.tar.xz "build/meson-dist/libcamera-${GITHUB_REF_NAME:1}.tar.xz"
- name: Release tarball
uses: softprops/action-gh-release@v1
with:
files: build/meson-dist/*.tar.xz
- if: failure()
run: cat build/meson-logs/meson-log.txt
2 changes: 1 addition & 1 deletion Documentation/guides/pipeline-handler.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ to the libcamera build options in the top level ``meson_options.txt``.

option('pipelines',
type : 'array',
choices : ['ipu3', 'rkisp1', 'rpi/vc4', 'simple', 'uvcvideo', 'vimc', 'vivid'],
choices : ['ipu3', 'rkisp1', 'rpi/pisp', 'rpi/vc4', 'simple', 'uvcvideo', 'vimc', 'vivid'],
description : 'Select which pipeline handlers to include')


Expand Down
2 changes: 2 additions & 0 deletions include/libcamera/internal/bayer_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class BayerFormat
None = 0,
CSI2 = 1,
IPU3 = 2,
PISP1 = 3,
PISP2 = 4,
};

constexpr BayerFormat()
Expand Down
1 change: 1 addition & 0 deletions include/libcamera/ipa/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ libcamera_generated_ipa_headers += custom_target('core_ipa_serializer_h',
pipeline_ipa_mojom_mapping = {
'ipu3': 'ipu3.mojom',
'rkisp1': 'rkisp1.mojom',
'rpi/pisp': 'raspberrypi.mojom',
'rpi/vc4': 'raspberrypi.mojom',
'vimc': 'vimc.mojom',
}
Expand Down
2 changes: 2 additions & 0 deletions include/libcamera/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ controls_map = {
'controls': {
'draft': 'control_ids_draft.yaml',
'core': 'control_ids_core.yaml',
'rpi/pisp': 'control_ids_rpi.yaml',
'rpi/vc4': 'control_ids_rpi.yaml',
},

'properties': {
Expand Down
9 changes: 9 additions & 0 deletions include/linux/drm_fourcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ extern "C" {
#define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */
#define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */

/* 48 bpp RGB */
#define DRM_FORMAT_RGB161616 fourcc_code('R', 'G', '4', '8') /* [48:0] R:G:B 16:16:16 little endian */
#define DRM_FORMAT_BGR161616 fourcc_code('B', 'G', '4', '8') /* [48:0] R:G:B 16:16:16 little endian */

/* 64 bpp RGB */
#define DRM_FORMAT_XRGB16161616 fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */
#define DRM_FORMAT_XBGR16161616 fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */
Expand Down Expand Up @@ -448,6 +452,7 @@ extern "C" {
#define DRM_FORMAT_MOD_VENDOR_ALLWINNER 0x09
#define DRM_FORMAT_MOD_VENDOR_AMLOGIC 0x0a
#define DRM_FORMAT_MOD_VENDOR_MIPI 0x0b
#define DRM_FORMAT_MOD_VENDOR_RPI 0x0c

/* add more to the end as needed */

Expand Down Expand Up @@ -1554,6 +1559,10 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier)
*/
#define MIPI_FORMAT_MOD_CSI2_PACKED fourcc_mod_code(MIPI, 1)

#define PISP_FORMAT_MOD_COMPRESS_MODE1 fourcc_mod_code(RPI, 1)
#define PISP_FORMAT_MOD_COMPRESS_MODE2 fourcc_mod_code(RPI, 2)
#define PISP_FORMAT_MOD_VERIFICATION fourcc_mod_code(RPI, 3)

#if defined(__cplusplus)
}
#endif
Expand Down
1 change: 1 addition & 0 deletions include/linux/media-bus-format.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@
#define MEDIA_BUS_FMT_YUYV12_2X12 0x201e
#define MEDIA_BUS_FMT_YVYU12_2X12 0x201f
#define MEDIA_BUS_FMT_Y14_1X14 0x202d
#define MEDIA_BUS_FMT_Y16_1X16 0x202e
#define MEDIA_BUS_FMT_UYVY8_1X16 0x200f
#define MEDIA_BUS_FMT_VYUY8_1X16 0x2010
#define MEDIA_BUS_FMT_YUYV8_1X16 0x2011
Expand Down
26 changes: 26 additions & 0 deletions include/linux/videodev2.h
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,10 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4') /* 32 ARGB-8-8-8-8 */
#define V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4') /* 32 XRGB-8-8-8-8 */

/* RGB formats (6 bytes per pixel) */
#define V4L2_PIX_FMT_BGR48 v4l2_fourcc('B', 'G', 'R', '6') /* 16 BGR-16-16-16 */
#define V4L2_PIX_FMT_RGB48 v4l2_fourcc('R', 'G', 'B', '6') /* 16 RGB-16-16-16 */

/* Grey formats */
#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
#define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
Expand Down Expand Up @@ -752,6 +756,19 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_IPU3_SGRBG10 v4l2_fourcc('i', 'p', '3', 'G') /* IPU3 packed 10-bit GRBG bayer */
#define V4L2_PIX_FMT_IPU3_SRGGB10 v4l2_fourcc('i', 'p', '3', 'r') /* IPU3 packed 10-bit RGGB bayer */

/* The pixel format for all our buffers (the precise format is found in the config buffer). */
#define V4L2_PIX_FMT_RPI_BE v4l2_fourcc('R', 'P', 'B', 'P')
#define V4L2_PIX_FMT_PISP_COMP1_RGGB v4l2_fourcc('P', 'C', '1', 'R')
#define V4L2_PIX_FMT_PISP_COMP1_GRBG v4l2_fourcc('P', 'C', '1', 'G')
#define V4L2_PIX_FMT_PISP_COMP1_GBRG v4l2_fourcc('P', 'C', '1', 'g')
#define V4L2_PIX_FMT_PISP_COMP1_BGGR v4l2_fourcc('P', 'C', '1', 'B')
#define V4L2_PIX_FMT_PISP_COMP1_MONO v4l2_fourcc('P', 'C', '1', 'M')
#define V4L2_PIX_FMT_PISP_COMP2_RGGB v4l2_fourcc('P', 'C', '2', 'R')
#define V4L2_PIX_FMT_PISP_COMP2_GRBG v4l2_fourcc('P', 'C', '2', 'G')
#define V4L2_PIX_FMT_PISP_COMP2_GBRG v4l2_fourcc('P', 'C', '2', 'g')
#define V4L2_PIX_FMT_PISP_COMP2_BGGR v4l2_fourcc('P', 'C', '2', 'B')
#define V4L2_PIX_FMT_PISP_COMP2_MONO v4l2_fourcc('P', 'C', '2', 'M')

/* SDR formats - used only for Software Defined Radio devices */
#define V4L2_SDR_FMT_CU8 v4l2_fourcc('C', 'U', '0', '8') /* IQ u8 */
#define V4L2_SDR_FMT_CU16LE v4l2_fourcc('C', 'U', '1', '6') /* IQ u16le */
Expand Down Expand Up @@ -781,6 +798,15 @@ struct v4l2_pix_format {
#define V4L2_META_FMT_RK_ISP1_PARAMS v4l2_fourcc('R', 'K', '1', 'P') /* Rockchip ISP1 3A Parameters */
#define V4L2_META_FMT_RK_ISP1_STAT_3A v4l2_fourcc('R', 'K', '1', 'S') /* Rockchip ISP1 3A Statistics */

/* The metadata format identifier for BE configuration buffers. */
#define V4L2_META_FMT_RPI_BE_CFG v4l2_fourcc('R', 'P', 'B', 'C')

/* The metadata format identifier for FE configuration buffers. */
#define V4L2_META_FMT_RPI_FE_CFG v4l2_fourcc('R', 'P', 'F', 'C')

/* The metadata format identifier for FE stats buffers. */
#define V4L2_META_FMT_RPI_FE_STATS v4l2_fourcc('R', 'P', 'F', 'S')

/* priv field value to indicates that subsequent fields are valid. */
#define V4L2_PIX_FMT_PRIV_MAGIC 0xfeedcafe

Expand Down
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ pipelines_support = {
'imx8-isi': arch_arm,
'ipu3': arch_x86,
'rkisp1': arch_arm,
'rpi/pisp': arch_arm,
'rpi/vc4': arch_arm,
'simple': arch_arm,
'uvcvideo': ['any'],
Expand Down
3 changes: 2 additions & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ option('gstreamer',

option('ipas',
type : 'array',
choices : ['ipu3', 'rkisp1', 'rpi/vc4', 'vimc'],
choices : ['ipu3', 'rkisp1', 'rpi/pisp', 'rpi/vc4', 'vimc'],
description : 'Select which IPA modules to build')

option('lc-compliance',
Expand All @@ -44,6 +44,7 @@ option('pipelines',
'imx8-isi',
'ipu3',
'rkisp1',
'rpi/pisp',
'rpi/vc4',
'simple',
'uvcvideo',
Expand Down
Loading