about summary refs log tree commit diff
path: root/users/flokli/ipu6-softisp/libcamera/0002-ov01a1s-HACK.patch
diff options
context:
space:
mode:
authorAspen Smith <root@gws.fyi>2024-07-28T16·58-0400
committerclbot <clbot@tvl.fyi>2024-08-01T10·06+0000
commit756539a59687f9abc9fef5fce50b5590c35a242f (patch)
tree06bd57732c359bb5b366b225043b59c6dd2f2ad9 /users/flokli/ipu6-softisp/libcamera/0002-ov01a1s-HACK.patch
parentbdf82698592acc3f27fa7a9aa612ea1ad7970437 (diff)
chore(3p/sources): Bump channels & overlays (2024-07-28) r/8435
* Treewide: re-run depotfmt

* //third_party/nixpkgs:html5validator: build with Python 3.11,
  dependency openstackdocstheme doesn't support 3.12

* //users/sterni/machines/ingeborg: adapt to poorly handled fcgiwrap
  module API change: https://github.com/NixOS/nixpkgs/pull/318599

* //tvix/*-go: regenerate protobuf files

* //third_party/nixpkgs:treefmt: Remove patch for merged pull request

* //users/flokli/ipu6-softisp: rebase, drop upstreamed kernel patches

Change-Id: Ie4e0df007c287e8cd6207683a9a25838aa5bd39a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11971
Autosubmit: sterni <sternenseemann@systemli.org>
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: flokli <flokli@flokli.de>
Reviewed-by: aspen <root@gws.fyi>
Tested-by: BuildkiteCI
Reviewed-by: tazjin <tazjin@tvl.su>
Reviewed-by: Ilan Joselevich <personal@ilanjoselevich.com>
Diffstat (limited to 'users/flokli/ipu6-softisp/libcamera/0002-ov01a1s-HACK.patch')
-rw-r--r--users/flokli/ipu6-softisp/libcamera/0002-ov01a1s-HACK.patch93
1 files changed, 93 insertions, 0 deletions
diff --git a/users/flokli/ipu6-softisp/libcamera/0002-ov01a1s-HACK.patch b/users/flokli/ipu6-softisp/libcamera/0002-ov01a1s-HACK.patch
new file mode 100644
index 000000000000..61316d10427f
--- /dev/null
+++ b/users/flokli/ipu6-softisp/libcamera/0002-ov01a1s-HACK.patch
@@ -0,0 +1,93 @@
+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
+