From e39c8d368a4afff0d84037d965c4f2c8bb722dea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81ngel=20Ren=C3=A9?= <17342133+angelrenefm@users.noreply.github.com> Date: Wed, 4 Nov 2026 00:03:08 +0100 Subject: [PATCH] device-panther: open the DMA heaps to the video group, as cheetah libcamera's software ISP allocates its buffers from /dev/dma_heap. Without cheetah's rule the heaps are root-only on the Pixel 7, so the simple pipeline logs "Could not open any dma-buf provider", disables software debayering, and the camera app gets raw BA10 frames it can't show. The rule is cheetah's file, unchanged; test/all checks that it stays so and that install stages it. Tested on a Pixel 7 with the camera nodes from kernel commits not yet proposed and the camera overlays: with the rule copied by hand, omacam streams the main camera at 2008x1136. This package build itself has not been installed on the phone. I used AI help (Claude) to work on this. --- packages/omamobile-device-panther/README.md | 1 + packages/omamobile-device-panther/install | 3 ++- packages/omamobile-device-panther/test/all | 5 +++-- .../vendor/udev/rules.d/70-omamobile-dma-heap.rules | 8 ++++++++ 4 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 packages/omamobile-device-panther/vendor/udev/rules.d/70-omamobile-dma-heap.rules diff --git a/packages/omamobile-device-panther/README.md b/packages/omamobile-device-panther/README.md index e375aeaa0..9b632c2b2 100644 --- a/packages/omamobile-device-panther/README.md +++ b/packages/omamobile-device-panther/README.md @@ -7,6 +7,7 @@ Omarchy Mobile's first userspace package for the Google Pixel 7 (codename panthe | `vendor/udev/rules.d/10-omamobile-storage.rules` | `/usr/lib/udev/rules.d` | Hides `sda` and every Android partition except `userdata` from desktop tools. Same rule as the Pixel 7 Pro. The initramfs stops its guard loop before `switch_root`; the kernel's read-only flags are what remain | | `vendor/udev/rules.d/20-omamobile-gpu-always-on.rules` | `/usr/lib/udev/rules.d` | Keeps the Mali-G710 powered while Panthor drives it: powering its domain back up needs a secure call our kernel doesn't make yet. Same rule as the Pixel 7 Pro | | `vendor/udev/rules.d/72-omamobile-feedbackd.rules` | `/usr/lib/udev/rules.d` | Lets feedbackd drive the CS40L26 haptics (`cs40l26_vibra`). Same rule as the Pixel 7 Pro; the driver needs the phone's own `cs40l26.wmfw` (`tools/extract-vendor-firmware -d panther`) | +| `vendor/udev/rules.d/70-omamobile-dma-heap.rules` | `/usr/lib/udev/rules.d` | Lets the video group (and the seat's user) use the general DMA-BUF heaps, which libcamera's software ISP needs in a user session. Same rule as the Pixel 7 Pro | | `vendor/systemd/network/20-usb-gadget.network` | `/usr/lib/systemd/network` | Sets usb0 to 172.16.42.1/24 after handover | | `bin/omamobile-usb-rescue`, `vendor/systemd/system/omamobile-usb-rescue.service` | `/usr/bin`, `/usr/lib/systemd/system` (enabled for `multi-user.target`) | Brings USB back after a replug: the MAX77759 opens its USB2 data switch on unplug, and with no Type-C driver nothing closes it. While VBUS is valid, puts the switch back to 0x09 on the chip's I2C bus (USI13, which the board file enables). Reads two registers and writes that one; stands aside once a Type-C driver owns the chip. Same script and unit as the Pixel 7 Pro; needs `i2c-tools` | | `vendor/systemd/logind.conf.d/10-omamobile-power-key.conf` | `/usr/lib/systemd/logind.conf.d` | A short power press does not power the phone off. Same drop-in as the Pixel 7 Pro. The long press stays the PMIC reset | diff --git a/packages/omamobile-device-panther/install b/packages/omamobile-device-panther/install index e8b009dc2..29ab64509 100755 --- a/packages/omamobile-device-panther/install +++ b/packages/omamobile-device-panther/install @@ -17,7 +17,8 @@ ln -sfn ../omamobile-usb-rescue.service \ "$destination/usr/lib/systemd/system/multi-user.target.wants/omamobile-usb-rescue.service" install -Dm644 vendor/udev/rules.d/10-omamobile-storage.rules \ "$destination/usr/lib/udev/rules.d/10-omamobile-storage.rules" -for rules in 20-omamobile-gpu-always-on.rules 72-omamobile-feedbackd.rules; do +for rules in 20-omamobile-gpu-always-on.rules 72-omamobile-feedbackd.rules \ + 70-omamobile-dma-heap.rules; do install -Dm644 "vendor/udev/rules.d/$rules" "$destination/usr/lib/udev/rules.d/$rules" done install -Dm644 vendor/systemd/network/20-usb-gadget.network \ diff --git a/packages/omamobile-device-panther/test/all b/packages/omamobile-device-panther/test/all index 338880eb3..858540bd7 100755 --- a/packages/omamobile-device-panther/test/all +++ b/packages/omamobile-device-panther/test/all @@ -40,11 +40,11 @@ if [[ -f ../omamobile-device-cheetah/src/reboot-to.c ]]; then ../omamobile-device-cheetah/vendor/systemd/sleep.conf.d/10-omamobile.conf \ || fail "the sleep drop-in drifted from the cheetah package" pass "the sleep drop-in matches the cheetah package" - for rules in 20-omamobile-gpu-always-on.rules 72-omamobile-feedbackd.rules; do + for rules in 20-omamobile-gpu-always-on.rules 72-omamobile-feedbackd.rules 70-omamobile-dma-heap.rules; do cmp -s "vendor/udev/rules.d/$rules" "../omamobile-device-cheetah/vendor/udev/rules.d/$rules" \ || fail "$rules drifted from the cheetah package" done - pass "the GPU and feedbackd rules match the cheetah package" + pass "the GPU, feedbackd and DMA heap rules match the cheetah package" cmp -s omamobile-device-panther.install \ ../omamobile-device-cheetah/omamobile-device-cheetah.install \ || fail "the pacman install script drifted from the cheetah package" @@ -77,6 +77,7 @@ for f in usr/bin/reboot-to \ usr/lib/udev/rules.d/10-omamobile-storage.rules \ usr/lib/udev/rules.d/20-omamobile-gpu-always-on.rules \ usr/lib/udev/rules.d/72-omamobile-feedbackd.rules \ + usr/lib/udev/rules.d/70-omamobile-dma-heap.rules \ usr/lib/systemd/network/20-usb-gadget.network \ usr/lib/systemd/logind.conf.d/10-omamobile-power-key.conf \ usr/lib/systemd/sleep.conf.d/10-omamobile.conf \ diff --git a/packages/omamobile-device-panther/vendor/udev/rules.d/70-omamobile-dma-heap.rules b/packages/omamobile-device-panther/vendor/udev/rules.d/70-omamobile-dma-heap.rules new file mode 100644 index 000000000..2341cae32 --- /dev/null +++ b/packages/omamobile-device-panther/vendor/udev/rules.d/70-omamobile-dma-heap.rules @@ -0,0 +1,8 @@ +# SPDX-License-Identifier: MIT +# libcamera's software ISP (and so PipeWire's libcamera plugin, which runs in +# the user's WirePlumber) allocates its output buffers from the DMA-BUF heaps. +# They are root-only by default, so without this a user session saw the +# cameras but got no debayered stream ("Could not open any dma-buf provider", +# device/cheetah/CAMERA-PLAN.md CAM5.4). Give the video group and the seat's +# user the general heaps; the camera and display pools stay the kernel's. +SUBSYSTEM=="dma_heap", KERNEL=="system|reserved|default_cma_region", GROUP="video", MODE="0660", TAG+="uaccess"