chore(users/flokli/ipu6-softisp): remove

This didn't work properly for a while, at least expose too many cameras
for browsers to get confused.

It also doesn't apply cleanly to the 6.12.1 kernel.

Change-Id: I8a23cc0ae0547bfde5756ee84953b60f4b0a2df2
Reviewed-on: https://cl.tvl.fyi/c/depot/+/12866
Reviewed-by: flokli <flokli@flokli.de>
Tested-by: BuildkiteCI
Reviewed-by: sterni <sternenseemann@systemli.org>
Autosubmit: flokli <flokli@flokli.de>
This commit is contained in:
Florian Klink 2024-12-04 21:04:11 +02:00 committed by clbot
parent 962df219f7
commit e743e2439c
9 changed files with 0 additions and 1986 deletions

View file

@ -1,29 +0,0 @@
# ipu6-softisp
This code adds support for the ipu6 webcams via libcamera, based on the work in
https://copr.fedorainfracloud.org/coprs/jwrdegoede/ipu6-softisp/.
It's supposed to be included in your NixOS configuration imports, and will:
- Add some patches to your kernel, which should apply on 6.8.x
- Add the `ipu6-camera-bins` firmware (still needed)
- Enable some kernel config options
- Add an udev rule so libcamera can do DMABUF things
- Override `services.pipewire.package` and
`services.pipewire.wireplumber.package` to use a pipewire built with a libcamera
with support for this webcam.
Please make sure you don't have any of the `hardware.ipu6` options still
enabled, as they use the closed-source userspace stack and will conflict.
Also make sure to track nixos-unstable for this. This code will get periodically
updated to be compatible with nixos-unstable!
The testing instructions from
https://copr.fedorainfracloud.org/coprs/jwrdegoede/ipu6-softisp/ still apply.
`qcam` can be found in `libcamera-qcam` (pending on
https://github.com/NixOS/nixpkgs/pull/284964 to trickle into master).
Thanks to Hans de Goede for helping me bringing this up, as well as to
puckipedia for sorting out some pipewire-related confusion.

View file

@ -1,56 +0,0 @@
{ pkgs, lib, ... }:
let
libcamera = pkgs.libcamera.overrideAttrs (old: {
mesonFlags = old.mesonFlags or [ ] ++ [
"-Dpipelines=simple,ipu3,uvcvideo"
"-Dipas=simple,ipu3"
];
# This is
# https://copr-dist-git.fedorainfracloud.org/cgit/jwrdegoede/ipu6-softisp/libcamera.git/plain/libcamera-0.2.0-softisp.patch?h=f39&id=60e6b3d5e366a360a75942073dc0d642e4900982,
# but manually piped to git and back, as some renames were not processed properly.
# It was later refreshed with https://patchwork.libcamera.org/cover/19663/
patches = old.patches or [ ] ++ [
./libcamera/0001-libcamera-Add-support-for-IGIG_GBGR_IGIG_GRGB-bayer-.patch
./libcamera/0002-ov01a1s-HACK.patch
./libcamera/0003-libcamera-debayer_cpu-Make-the-minimum-size-1280x720.patch
];
});
# use patched libcamera
pipewire' = (pkgs.pipewire.override {
inherit libcamera;
});
wireplumber' = (pkgs.wireplumber.override {
pipewire = pipewire';
});
in
{
boot.kernelPatches = [{
name = "linux-kernel-test.patch";
patch = ./kernel/softisp.patch;
extraStructuredConfig = {
# needed for /dev/dma_heap
DMABUF_HEAPS_CMA = lib.kernel.yes;
DMABUF_HEAPS_SYSTEM = lib.kernel.yes;
DMABUF_HEAPS = lib.kernel.yes;
};
}];
services.udev.extraRules = ''
KERNEL=="system", SUBSYSTEM=="dma_heap", TAG+="uaccess"
'';
# provide qcam in $PATH.
environment.systemPackages = [
(libcamera.override {
withQcam = true;
})
];
services.pipewire.package = pipewire';
services.pipewire.wireplumber.package = wireplumber';
}

View file

@ -1,60 +0,0 @@
# This file ensures the fixes from ./config.nix build with the version of
# nixpkgs from depot.
# If you're an outside user of this, import config.nix as a NixOS module (and
# check the README.md file).
{ depot
, pkgs
, ...
}:
let
systemFor = sys: (depot.ops.nixos.nixosFor sys).system;
in
(depot.nix.readTree.drvTargets rec {
testSystem = (systemFor ({ modulesPath, pkgs, ... }: {
imports = [
# Import the module, this is something a user would do in their config.
./config.nix
];
# Make sure we use the linuxPackages_latest.
boot.kernelPackages = pkgs.linuxPackages_latest;
# Enable firmware.
hardware.enableAllFirmware = true;
# Set some options necessary to evaluate.
boot.loader.systemd-boot.enable = true;
fileSystems."/" = {
device = "/dev/disk/by-partlabel/root";
fsType = "xfs";
};
# Enable pipewire and wireplumber.
services.pipewire = {
enable = true;
wireplumber.enable = true;
};
# Shut off the warning.
system.stateVersion = "24.05";
})) // {
# 2024-07-28 aspen: The patches no longer cleanly apply on upstream
meta.broken = true;
};
# Make sure the firmware requested by the driver is present in our firmware.
# We do have a .zst suffix here, but that's fine, since request_firmware does
# check ${name}.zst too in case CONFIG_FW_LOADER_COMPRESS is set.
# The path needs to be kept in sync with the ones used in the kernel patch.
checkFirmware = pkgs.runCommand "check-firmware" { } ''
stat ${testSystem}/firmware/intel/ipu/ipu6se_fw.bin.zst
stat ${testSystem}/firmware/intel/ipu/ipu6ep_fw.bin.zst
stat ${testSystem}/firmware/intel/ipu/ipu6_fw.bin.zst
stat ${testSystem}/firmware/intel/ipu/ipu6epmtl_fw.bin.zst
# all good, succeed build
touch $out
'';
})

File diff suppressed because it is too large Load diff

View file

@ -1,243 +0,0 @@
From 0e94883c2f4f6164d40d4ea355449ba0864dc4f9 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 19 Dec 2023 11:16:26 +0100
Subject: [PATCH 1/3] libcamera: Add support for IGIG_GBGR_IGIG_GRGB bayer
order DNU
The ov01a1s sensor has the following bayer pattern (4x4 tile repeating):
IGIG
GBGR
IGIG
GRGB
Add support for this PixelFormat to libcamera.
Do Not Upstream, first the include/linux/media-bus-format.h and
include/linux/videodev2.h changes need to land in the upstream kernel.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
include/libcamera/internal/bayer_format.h | 3 ++-
include/linux/drm_fourcc.h | 2 ++
include/linux/media-bus-format.h | 4 +++-
include/linux/videodev2.h | 3 +++
src/libcamera/bayer_format.cpp | 5 +++++
src/libcamera/formats.cpp | 20 ++++++++++++++++++++
src/libcamera/formats.yaml | 5 +++++
src/libcamera/sensor/camera_sensor.cpp | 3 +++
src/libcamera/v4l2_pixelformat.cpp | 4 ++++
src/libcamera/v4l2_subdevice.cpp | 7 +++++++
10 files changed, 54 insertions(+), 2 deletions(-)
diff --git a/include/libcamera/internal/bayer_format.h b/include/libcamera/internal/bayer_format.h
index 5c14bb5f..49b7f417 100644
--- a/include/libcamera/internal/bayer_format.h
+++ b/include/libcamera/internal/bayer_format.h
@@ -27,7 +27,8 @@ public:
GBRG = 1,
GRBG = 2,
RGGB = 3,
- MONO = 4
+ MONO = 4,
+ IGIG_GBGR_IGIG_GRGB = 5,
};
enum class Packing : uint16_t {
diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h
index b4e1a092..070696bc 100644
--- a/include/linux/drm_fourcc.h
+++ b/include/linux/drm_fourcc.h
@@ -447,6 +447,8 @@ extern "C" {
#define DRM_FORMAT_SGRBG10 fourcc_code('B', 'A', '1', '0')
#define DRM_FORMAT_SGBRG10 fourcc_code('G', 'B', '1', '0')
#define DRM_FORMAT_SBGGR10 fourcc_code('B', 'G', '1', '0')
+/* Mixed 10 bit bayer + ir pixel pattern found on Omnivision ov01a1s */
+#define DRM_FORMAT_SIGIG_GBGR_IGIG_GRGB10 fourcc_code('O', 'V', '1', 'S')
/* 12-bit Bayer formats */
#define DRM_FORMAT_SRGGB12 fourcc_code('R', 'G', '1', '2')
diff --git a/include/linux/media-bus-format.h b/include/linux/media-bus-format.h
index f05f747e..1b4a65db 100644
--- a/include/linux/media-bus-format.h
+++ b/include/linux/media-bus-format.h
@@ -121,7 +121,7 @@
#define MEDIA_BUS_FMT_YUV16_1X48 0x202a
#define MEDIA_BUS_FMT_UYYVYY16_0_5X48 0x202b
-/* Bayer - next is 0x3021 */
+/* Bayer - next is 0x3022 */
#define MEDIA_BUS_FMT_SBGGR8_1X8 0x3001
#define MEDIA_BUS_FMT_SGBRG8_1X8 0x3013
#define MEDIA_BUS_FMT_SGRBG8_1X8 0x3002
@@ -154,6 +154,8 @@
#define MEDIA_BUS_FMT_SGBRG16_1X16 0x301e
#define MEDIA_BUS_FMT_SGRBG16_1X16 0x301f
#define MEDIA_BUS_FMT_SRGGB16_1X16 0x3020
+/* Mixed bayer + ir pixel pattern found on ov01a1s */
+#define MEDIA_BUS_FMT_SIGIG_GBGR_IGIG_GRGB10_1X10 0x3021
/* JPEG compressed formats - next is 0x4002 */
#define MEDIA_BUS_FMT_JPEG_1X8 0x4001
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 0b5482a0..a51d6755 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -704,6 +704,9 @@ struct v4l2_pix_format {
#define V4L2_PIX_FMT_SGBRG16 v4l2_fourcc('G', 'B', '1', '6') /* 16 GBGB.. RGRG.. */
#define V4L2_PIX_FMT_SGRBG16 v4l2_fourcc('G', 'R', '1', '6') /* 16 GRGR.. BGBG.. */
#define V4L2_PIX_FMT_SRGGB16 v4l2_fourcc('R', 'G', '1', '6') /* 16 RGRG.. GBGB.. */
+ /* 10bit mixed bayer + ir pixel pattern found on ov01a1s */
+#define V4L2_PIX_FMT_SIGIG_GBGR_IGIG_GRGB10 v4l2_fourcc('O', 'V', '1', 'S') /* unpacked */
+#define V4L2_PIX_FMT_SIGIG_GBGR_IGIG_GRGB10P v4l2_fourcc('O', 'V', '1', 'P') /* packed */
/* HSV formats */
#define V4L2_PIX_FMT_HSV24 v4l2_fourcc('H', 'S', 'V', '3')
diff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp
index 014f716d..325887a2 100644
--- a/src/libcamera/bayer_format.cpp
+++ b/src/libcamera/bayer_format.cpp
@@ -112,6 +112,8 @@ const std::map<BayerFormat, Formats, BayerFormatComparator> bayerToFormat{
{ formats::SGRBG10, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10) } },
{ { BayerFormat::RGGB, 10, BayerFormat::Packing::None },
{ formats::SRGGB10, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10) } },
+ { { BayerFormat::IGIG_GBGR_IGIG_GRGB, 10, BayerFormat::Packing::None },
+ { formats::SIGIG_GBGR_IGIG_GRGB10, V4L2PixelFormat(V4L2_PIX_FMT_SIGIG_GBGR_IGIG_GRGB10) } },
{ { BayerFormat::BGGR, 10, BayerFormat::Packing::CSI2 },
{ formats::SBGGR10_CSI2P, V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P) } },
{ { BayerFormat::GBRG, 10, BayerFormat::Packing::CSI2 },
@@ -120,6 +122,8 @@ const std::map<BayerFormat, Formats, BayerFormatComparator> bayerToFormat{
{ formats::SGRBG10_CSI2P, V4L2PixelFormat(V4L2_PIX_FMT_SGRBG10P) } },
{ { BayerFormat::RGGB, 10, BayerFormat::Packing::CSI2 },
{ formats::SRGGB10_CSI2P, V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10P) } },
+ { { BayerFormat::IGIG_GBGR_IGIG_GRGB, 10, BayerFormat::Packing::CSI2 },
+ { formats::SIGIG_GBGR_IGIG_GRGB10_CSI2P, V4L2PixelFormat(V4L2_PIX_FMT_SIGIG_GBGR_IGIG_GRGB10P) } },
{ { BayerFormat::BGGR, 10, BayerFormat::Packing::IPU3 },
{ formats::SBGGR10_IPU3, V4L2PixelFormat(V4L2_PIX_FMT_IPU3_SBGGR10) } },
{ { BayerFormat::GBRG, 10, BayerFormat::Packing::IPU3 },
@@ -211,6 +215,7 @@ const std::unordered_map<unsigned int, BayerFormat> mbusCodeToBayer{
{ MEDIA_BUS_FMT_SGBRG10_1X10, { BayerFormat::GBRG, 10, BayerFormat::Packing::None } },
{ MEDIA_BUS_FMT_SGRBG10_1X10, { BayerFormat::GRBG, 10, BayerFormat::Packing::None } },
{ MEDIA_BUS_FMT_SRGGB10_1X10, { BayerFormat::RGGB, 10, BayerFormat::Packing::None } },
+ { MEDIA_BUS_FMT_SIGIG_GBGR_IGIG_GRGB10_1X10, { BayerFormat::IGIG_GBGR_IGIG_GRGB, 10, BayerFormat::Packing::None } },
{ MEDIA_BUS_FMT_SBGGR12_1X12, { BayerFormat::BGGR, 12, BayerFormat::Packing::None } },
{ MEDIA_BUS_FMT_SGBRG12_1X12, { BayerFormat::GBRG, 12, BayerFormat::Packing::None } },
{ MEDIA_BUS_FMT_SGRBG12_1X12, { BayerFormat::GRBG, 12, BayerFormat::Packing::None } },
diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index cf41f2c2..13ac3253 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -639,6 +639,16 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
.pixelsPerGroup = 2,
.planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
} },
+ { formats::SIGIG_GBGR_IGIG_GRGB10, {
+ .name = "SIGIG_GBGR_IGIG_GRGB10",
+ .format = formats::SIGIG_GBGR_IGIG_GRGB10,
+ .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SIGIG_GBGR_IGIG_GRGB10), },
+ .bitsPerPixel = 10,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = false,
+ .pixelsPerGroup = 4,
+ .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
{ formats::SBGGR10_CSI2P, {
.name = "SBGGR10_CSI2P",
.format = formats::SBGGR10_CSI2P,
@@ -679,6 +689,16 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
.pixelsPerGroup = 4,
.planes = {{ { 5, 1 }, { 0, 0 }, { 0, 0 } }},
} },
+ { formats::SIGIG_GBGR_IGIG_GRGB10_CSI2P, {
+ .name = "SIGIG_GBGR_IGIG_GRGB10_CSI2P",
+ .format = formats::SIGIG_GBGR_IGIG_GRGB10_CSI2P,
+ .v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_SIGIG_GBGR_IGIG_GRGB10P), },
+ .bitsPerPixel = 10,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ .packed = true,
+ .pixelsPerGroup = 4,
+ .planes = {{ { 4, 1 }, { 0, 0 }, { 0, 0 } }},
+ } },
{ formats::SBGGR12, {
.name = "SBGGR12",
.format = formats::SBGGR12,
diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml
index fe027a7c..394f980c 100644
--- a/src/libcamera/formats.yaml
+++ b/src/libcamera/formats.yaml
@@ -107,6 +107,8 @@ formats:
fourcc: DRM_FORMAT_SGBRG10
- SBGGR10:
fourcc: DRM_FORMAT_SBGGR10
+ - SIGIG_GBGR_IGIG_GRGB10:
+ fourcc: DRM_FORMAT_SIGIG_GBGR_IGIG_GRGB10
- SRGGB12:
fourcc: DRM_FORMAT_SRGGB12
@@ -151,6 +153,9 @@ formats:
- SBGGR10_CSI2P:
fourcc: DRM_FORMAT_SBGGR10
mod: MIPI_FORMAT_MOD_CSI2_PACKED
+ - SIGIG_GBGR_IGIG_GRGB10_CSI2P:
+ fourcc: DRM_FORMAT_SIGIG_GBGR_IGIG_GRGB10
+ mod: MIPI_FORMAT_MOD_CSI2_PACKED
- SRGGB12_CSI2P:
fourcc: DRM_FORMAT_SRGGB12
diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp
index c6d7f801..77c396b9 100644
--- a/src/libcamera/sensor/camera_sensor.cpp
+++ b/src/libcamera/sensor/camera_sensor.cpp
@@ -526,6 +526,9 @@ int CameraSensor::initProperties()
case BayerFormat::MONO:
cfa = properties::draft::MONO;
break;
+ case BayerFormat::IGIG_GBGR_IGIG_GRGB:
+ cfa = properties::draft::RGB;
+ break;
}
properties_.set(properties::draft::ColorFilterArrangement, cfa);
diff --git a/src/libcamera/v4l2_pixelformat.cpp b/src/libcamera/v4l2_pixelformat.cpp
index 70568335..a2fbd644 100644
--- a/src/libcamera/v4l2_pixelformat.cpp
+++ b/src/libcamera/v4l2_pixelformat.cpp
@@ -159,6 +159,8 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{
{ formats::SGRBG10, "10-bit Bayer GRGR/BGBG" } },
{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10),
{ formats::SRGGB10, "10-bit Bayer RGRG/GBGB" } },
+ { V4L2PixelFormat(V4L2_PIX_FMT_SIGIG_GBGR_IGIG_GRGB10),
+ { formats::SIGIG_GBGR_IGIG_GRGB10, "10-bit Bayer GRGB/IGIG/GBGR/IGIG" } },
{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR10P),
{ formats::SBGGR10_CSI2P, "10-bit Bayer BGBG/GRGR Packed" } },
{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG10P),
@@ -167,6 +169,8 @@ const std::map<V4L2PixelFormat, V4L2PixelFormat::Info> vpf2pf{
{ formats::SGRBG10_CSI2P, "10-bit Bayer GRGR/BGBG Packed" } },
{ V4L2PixelFormat(V4L2_PIX_FMT_SRGGB10P),
{ formats::SRGGB10_CSI2P, "10-bit Bayer RGRG/GBGB Packed" } },
+ { V4L2PixelFormat(V4L2_PIX_FMT_SIGIG_GBGR_IGIG_GRGB10P),
+ { formats::SIGIG_GBGR_IGIG_GRGB10_CSI2P, "10-bit Bayer GRGB/IGIG/GBGR/IGIG Packed" } },
{ V4L2PixelFormat(V4L2_PIX_FMT_SBGGR12),
{ formats::SBGGR12, "12-bit Bayer BGBG/GRGR" } },
{ V4L2PixelFormat(V4L2_PIX_FMT_SGBRG12),
diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp
index 6da77775..0ba8c0de 100644
--- a/src/libcamera/v4l2_subdevice.cpp
+++ b/src/libcamera/v4l2_subdevice.cpp
@@ -595,6 +595,13 @@ const std::map<uint32_t, MediaBusFormatInfo> mediaBusFormatInfo{
.bitsPerPixel = 10,
.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
} },
+ { MEDIA_BUS_FMT_SIGIG_GBGR_IGIG_GRGB10_1X10, {
+ .name = "SIGIG_GBGR_IGIG_GRGB10_1X10",
+ .code = MEDIA_BUS_FMT_SIGIG_GBGR_IGIG_GRGB10_1X10,
+ .type = MediaBusFormatInfo::Type::Image,
+ .bitsPerPixel = 10,
+ .colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+ } },
{ MEDIA_BUS_FMT_SBGGR12_1X12, {
.name = "SBGGR12_1X12",
.code = MEDIA_BUS_FMT_SBGGR12_1X12,
--
2.45.2

View file

@ -1,93 +0,0 @@
From 5895f4ed8163780446665b99b8d5dc31d6f2b791 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Tue, 19 Dec 2023 15:45:51 +0100
Subject: [PATCH 2/3] ov01a1s HACK
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/libcamera/sensor/camera_sensor.cpp | 6 ++++++
src/libcamera/software_isp/debayer_cpu.cpp | 7 +++++++
src/libcamera/software_isp/swstats_cpu.cpp | 4 ++++
3 files changed, 17 insertions(+)
diff --git a/src/libcamera/sensor/camera_sensor.cpp b/src/libcamera/sensor/camera_sensor.cpp
index 77c396b9..628b12f4 100644
--- a/src/libcamera/sensor/camera_sensor.cpp
+++ b/src/libcamera/sensor/camera_sensor.cpp
@@ -33,6 +33,9 @@
*/
namespace libcamera {
+
+// HACK HACK
+bool is_ov01a1s = false;
LOG_DEFINE_CATEGORY(CameraSensor)
@@ -442,6 +445,9 @@ int CameraSensor::initProperties()
model_ = subdev_->model();
properties_.set(properties::Model, utils::toAscii(model_));
+ if (model_ == "ov01a1s")
+ is_ov01a1s = true;
+
/* Generate a unique ID for the sensor. */
int ret = generateId();
if (ret)
diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp
index 8254bbe9..10ea29b1 100644
--- a/src/libcamera/software_isp/debayer_cpu.cpp
+++ b/src/libcamera/software_isp/debayer_cpu.cpp
@@ -23,6 +23,7 @@
namespace libcamera {
+extern bool is_ov01a1s;
/**
* \class DebayerCpu
* \brief Class for debayering on the CPU
@@ -275,6 +276,9 @@ int DebayerCpu::getInputConfig(PixelFormat inputFormat, DebayerInputConfig &conf
BayerFormat bayerFormat =
BayerFormat::fromPixelFormat(inputFormat);
+ if (is_ov01a1s)
+ bayerFormat.order = BayerFormat::IGIG_GBGR_IGIG_GRGB;
+
if ((bayerFormat.bitDepth == 8 || bayerFormat.bitDepth == 10 || bayerFormat.bitDepth == 12) &&
bayerFormat.packing == BayerFormat::Packing::None &&
isStandardBayerOrder(bayerFormat.order)) {
@@ -343,6 +347,9 @@ int DebayerCpu::setDebayerFunctions(PixelFormat inputFormat, PixelFormat outputF
BayerFormat bayerFormat =
BayerFormat::fromPixelFormat(inputFormat);
+ if (is_ov01a1s)
+ bayerFormat.order = BayerFormat::IGIG_GBGR_IGIG_GRGB;
+
xShift_ = 0;
swapRedBlueGains_ = false;
diff --git a/src/libcamera/software_isp/swstats_cpu.cpp b/src/libcamera/software_isp/swstats_cpu.cpp
index 815c4d4f..0b310f80 100644
--- a/src/libcamera/software_isp/swstats_cpu.cpp
+++ b/src/libcamera/software_isp/swstats_cpu.cpp
@@ -19,6 +19,7 @@
namespace libcamera {
+extern bool is_ov01a1s;
/**
* \class SwStatsCpu
* \brief Class for gathering statistics on the CPU
@@ -367,6 +368,9 @@ int SwStatsCpu::configure(const StreamConfiguration &inputCfg)
BayerFormat bayerFormat =
BayerFormat::fromPixelFormat(inputCfg.pixelFormat);
+ if (is_ov01a1s)
+ bayerFormat.order = BayerFormat::IGIG_GBGR_IGIG_GRGB;
+
if (bayerFormat.packing == BayerFormat::Packing::None &&
setupStandardBayerOrder(bayerFormat.order) == 0) {
switch (bayerFormat.bitDepth) {
--
2.45.2

View file

@ -1,42 +0,0 @@
From 06add438e4fc53faca6e016bd582df0e7ac5a271 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdegoede@redhat.com>
Date: Wed, 24 Jan 2024 20:44:29 +0100
Subject: [PATCH 3/3] libcamera: debayer_cpu: Make the minimum size 1280x720
pipewire + firefox default to what looks like 640x480 if we export
the entire supported cropping range. Hardcode 720p as minsize for now.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
src/libcamera/software_isp/debayer_cpu.cpp | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/src/libcamera/software_isp/debayer_cpu.cpp b/src/libcamera/software_isp/debayer_cpu.cpp
index 10ea29b1..a354138b 100644
--- a/src/libcamera/software_isp/debayer_cpu.cpp
+++ b/src/libcamera/software_isp/debayer_cpu.cpp
@@ -805,10 +805,17 @@ SizeRange DebayerCpu::sizes(PixelFormat inputFormat, const Size &inputSize)
return {};
}
- return SizeRange(Size(patternSize.width, patternSize.height),
- Size((inputSize.width - 2 * patternSize.width) & ~(patternSize.width - 1),
- (inputSize.height - 2 * borderHeight) & ~(patternSize.height - 1)),
- patternSize.width, patternSize.height);
+ /*
+ * pipewire + firefox default to what looks like 640x480
+ * if we export the entire supported cropping range.
+ * Hardcode 720p as minsize for now. Minsize should be
+ * Size(patternSize.width, patternSize.height)
+ */
+ unsigned int w = (inputSize.width - 2 * patternSize.width) & ~(patternSize.width - 1);
+ unsigned int h = (inputSize.height - 2 * patternSize.height) & ~(patternSize.height - 1);
+ return SizeRange(Size(std::min(w, 1280u), std::min(h, 720u)),
+ Size(w, h),
+ patternSize.width, patternSize.height);
}
} /* namespace libcamera */
--
2.45.2