about summary refs log tree commit diff
path: root/users/flokli/ipu6-softisp/libcamera/0025-libcamera-debayer_cpu-Make-the-minimum-size-1280x720.patch
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-01-30T09·43+0200
committerflokli <flokli@flokli.de>2024-01-30T09·54+0000
commitaf9a8d372b24710bf7fc27c8e81244e1ca6d1658 (patch)
treedf8bee03b202ec5081b9bd7e7b5d7b6ecdd28e1b /users/flokli/ipu6-softisp/libcamera/0025-libcamera-debayer_cpu-Make-the-minimum-size-1280x720.patch
parentb38be028d96ce107439f3323026270228a871a13 (diff)
feat(users/flokli/ipu6-softisp): init r/7454
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.

Change-Id: Ifb71999ad61161fa23506b97cb449f73fb1270e3
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10709
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
Autosubmit: flokli <flokli@flokli.de>
Diffstat (limited to 'users/flokli/ipu6-softisp/libcamera/0025-libcamera-debayer_cpu-Make-the-minimum-size-1280x720.patch')
-rw-r--r--users/flokli/ipu6-softisp/libcamera/0025-libcamera-debayer_cpu-Make-the-minimum-size-1280x720.patch40
1 files changed, 40 insertions, 0 deletions
diff --git a/users/flokli/ipu6-softisp/libcamera/0025-libcamera-debayer_cpu-Make-the-minimum-size-1280x720.patch b/users/flokli/ipu6-softisp/libcamera/0025-libcamera-debayer_cpu-Make-the-minimum-size-1280x720.patch
new file mode 100644
index 000000000000..1f267353c5e3
--- /dev/null
+++ b/users/flokli/ipu6-softisp/libcamera/0025-libcamera-debayer_cpu-Make-the-minimum-size-1280x720.patch
@@ -0,0 +1,40 @@
+From 4f2c94ba8b7f9f4d85a1d7e03f4c5272d92c3361 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 25/25] 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>
+---
+ include/libcamera/internal/software_isp/debayer.h | 13 ++++++++++---
+ 1 file changed, 10 insertions(+), 3 deletions(-)
+
+diff --git a/include/libcamera/internal/software_isp/debayer.h b/include/libcamera/internal/software_isp/debayer.h
+index 39e6f393..4348173d 100644
+--- a/include/libcamera/internal/software_isp/debayer.h
++++ b/include/libcamera/internal/software_isp/debayer.h
+@@ -112,9 +112,16 @@ public:
+ 			return {};
+ 		}
+ 
+-		return SizeRange(Size(pattern_size.width, pattern_size.height),
+-				 Size((inputSize.width - 2 * pattern_size.width) & ~(pattern_size.width - 1),
+-				      (inputSize.height - 2 * pattern_size.height) & ~(pattern_size.height - 1)),
++		/*
++		 * 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(pattern_size.width, pattern_size.height)
++		 */
++		unsigned int w = (inputSize.width - 2 * pattern_size.width) & ~(pattern_size.width - 1);
++		unsigned int h = (inputSize.height - 2 * pattern_size.height) & ~(pattern_size.height - 1);
++		return SizeRange(Size(std::min(w, 1280u), std::min(h, 720u)),
++				 Size(w, h),
+ 				 pattern_size.width, pattern_size.height);
+ 	}
+ 
+-- 
+2.43.0
+