Linux 7.2 changed how the Intel CVS controller (ACPI INTC10E1 on Panther Lake) appears to the IPU. ipu-bridge now places it between the sensor and the IPU CSI2 receiver, like IVSC, and the new in-tree drivers/media/i2c/cvs driver provides the matching "Intel CVS" V4L2 bridge sub-device. Our out-of-tree vision-drivers intel_cvs has no sub-device and displaces the in-tree module of the same name, so on 7.2 the sensor never joins the media graph and the HAL reports "No sensors available". Both linux-ptl 7.2.3 and linux-omarchy 7.2.5 fail this way. Ship the in-tree 7.2 CVS driver verbatim as DKMS module intel-cvs for 7.2+ kernels. Arch-derived kernel configs cannot enable CONFIG_VIDEO_INTEL_CVS themselves: it sits under a menu hidden by MEDIA_HIDE_ANCILLARY_SUBDRV, so olddefconfig drops it. Keep vision-drivers for kernels before 7.2. Both dkms.conf files carry a BUILD_EXCLUSIVE_KERNEL regex that the pacman dkms hook honours. Teach the camera HAL about the bridge with upstream ipu7-camera-hal commit f167239 (MediaControl routes the sensor link through "Intel CVS" and finds the I2C bus through it) and add "Intel CVS" pad formats to the ipu75xa ov08x40 config so link validation passes. Links stay sensor to CSI2 in the config and are rewritten at runtime, so the same files work on 7.1.
271 lines
10 KiB
Bash
271 lines
10 KiB
Bash
# Maintainer: Omarchy <packages@omarchy.org>
|
|
|
|
pkgname=intel-ipu7-camera
|
|
pkgver=1.0.6
|
|
pkgrel=1
|
|
pkgdesc="Intel IPU7 MIPI camera stack for Hurrican/Performance (OV08X40 + hardware ISP)"
|
|
arch=('x86_64')
|
|
url="https://github.com/TsaiGaggery/hurrican_omarchy_enabling"
|
|
license=('GPL-2.0-or-later')
|
|
depends=(
|
|
'dkms'
|
|
'linux-headers'
|
|
'v4l2loopback-dkms'
|
|
'v4l2-relayd'
|
|
'gstreamer'
|
|
'gst-plugins-base'
|
|
'gst-plugins-good'
|
|
'gst-plugins-bad'
|
|
'jsoncpp'
|
|
'libdrm'
|
|
)
|
|
makedepends=(
|
|
'git'
|
|
'base-devel'
|
|
'cmake'
|
|
'autoconf'
|
|
'automake'
|
|
'libtool'
|
|
'pkgconf'
|
|
)
|
|
install=intel-ipu7-camera.install
|
|
options=('!strip')
|
|
|
|
_ipu7_drivers_commit="a88b19096a738d0708742a78d6540d6d4a3021ff"
|
|
_vision_drivers_commit="a8d772f261bc90376944956b7bfd49b325ffa2f2"
|
|
_ipu7_camera_bins_commit="403c67db6b279dd02752f11db6a34552f31a3ac5"
|
|
_ipu7_camera_hal_commit="b1f6ebef12111fb5da0133b144d69dd9b001836c"
|
|
_icamerasrc_commit="4fb31db76b618aae72184c59314b839dedb42689"
|
|
|
|
# Linux 7.2 moved the Intel CVS (Computer Vision Sensing) controller into the
|
|
# IPU media graph: ipu-bridge now places it between the sensor and the IPU
|
|
# CSI2 receiver as an "Intel CVS" V4L2 bridge sub-device, provided by the
|
|
# in-tree drivers/media/i2c/cvs driver. The legacy vision-drivers misc driver
|
|
# has no such sub-device, so on 7.2 the sensor never joins the graph and the
|
|
# HAL finds no camera. We ship the in-tree driver verbatim as a DKMS module
|
|
# for 7.2+ kernels (Arch-derived kernel configs cannot enable it: the option
|
|
# is hidden behind MEDIA_HIDE_ANCILLARY_SUBDRV) and keep vision-drivers for
|
|
# older kernels. Both dkms.conf files carry matching BUILD_EXCLUSIVE_KERNEL.
|
|
_intel_cvs_kernel_tag="v7.2.5"
|
|
_intel_cvs_url="https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/plain/drivers/media/i2c/cvs"
|
|
|
|
source=(
|
|
"ipu7-drivers::git+https://github.com/intel/ipu7-drivers.git#commit=${_ipu7_drivers_commit}"
|
|
"vision-drivers::git+https://github.com/intel/vision-drivers.git#commit=${_vision_drivers_commit}"
|
|
"ipu7-camera-bins::git+https://github.com/intel/ipu7-camera-bins.git#commit=${_ipu7_camera_bins_commit}"
|
|
"ipu7-camera-hal::git+https://github.com/intel/ipu7-camera-hal.git#commit=${_ipu7_camera_hal_commit}"
|
|
"icamerasrc::git+https://github.com/intel/icamerasrc.git#commit=${_icamerasrc_commit}"
|
|
"intel-cvs-core.c::${_intel_cvs_url}/core.c?h=${_intel_cvs_kernel_tag}"
|
|
"intel-cvs-v4l2.c::${_intel_cvs_url}/v4l2.c?h=${_intel_cvs_kernel_tag}"
|
|
"intel-cvs-icvs.h::${_intel_cvs_url}/icvs.h?h=${_intel_cvs_kernel_tag}"
|
|
"0004-ipu7-psys-register-device-bus.patch"
|
|
"0003-icvs-set-rgbcamera_pwrup_host-0-for-Panther-Lake.patch"
|
|
"0005-camhal-MediaControl-route-through-Intel-CVS-bridge.patch"
|
|
"0006-camhal-ipu75xa-ov08x40-Intel-CVS-formats.patch"
|
|
"dkms-ipu7-drivers.conf"
|
|
"dkms-vision-drivers.conf"
|
|
"dkms-intel-cvs.conf"
|
|
"intel-cvs-Makefile"
|
|
"camera-deps.conf"
|
|
"v4l2loopback-modprobe.conf"
|
|
"camera-init.service"
|
|
"intel-ipu7-camera.service"
|
|
"hide-ipu7-v4l2.conf"
|
|
"disable-libcamera.conf"
|
|
"71-ipu7-hide-isys.rules"
|
|
"90-ipu7-psys.rules"
|
|
"camera-tmpfiles.conf"
|
|
"ov08x40.yaml"
|
|
"camera-sleep-hook"
|
|
"v4l2-relayd-ipu7.conf"
|
|
"v4l2-relayd-ipu7-override.conf"
|
|
)
|
|
sha256sums=(
|
|
'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP'
|
|
'b4a90ad1815c02e4cadc1b5ad6c576ae0b150cb365c68d2c934cf964a995d91f'
|
|
'e988014f54b1b5183e9ef43b602d73bbc2c991f19a8d503560a8cdba112b76c6'
|
|
'6dcd5201fb78766a440038c8eba2cc8c3892064ba829065e2269c30dc1905983'
|
|
'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP'
|
|
'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP'
|
|
'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP'
|
|
)
|
|
|
|
prepare() {
|
|
cd "${srcdir}/ipu7-drivers"
|
|
patch -Np1 -i "${srcdir}/0004-ipu7-psys-register-device-bus.patch"
|
|
|
|
cd "${srcdir}/vision-drivers"
|
|
git config user.email "build@localhost"
|
|
git config user.name "Build"
|
|
if ! git log --oneline -1 | grep -q "rgbcamera_pwrup_host"; then
|
|
git am "${srcdir}/0003-icvs-set-rgbcamera_pwrup_host-0-for-Panther-Lake.patch"
|
|
fi
|
|
|
|
# Route the media graph through the Linux 7.2 "Intel CVS" bridge entity
|
|
cd "${srcdir}/ipu7-camera-hal"
|
|
patch -Np1 -i "${srcdir}/0005-camhal-MediaControl-route-through-Intel-CVS-bridge.patch"
|
|
patch -Np1 -i "${srcdir}/0006-camhal-ipu75xa-ov08x40-Intel-CVS-formats.patch"
|
|
|
|
# Stage proprietary libs/headers for build-time use
|
|
local staging="${srcdir}/staging"
|
|
rm -rf "${staging}"
|
|
mkdir -p "${staging}/usr/lib" "${staging}/usr/include" "${staging}/usr/lib/pkgconfig"
|
|
|
|
cd "${srcdir}/ipu7-camera-bins"
|
|
cp -P lib/lib* "${staging}/usr/lib/"
|
|
cp -r include/* "${staging}/usr/include/"
|
|
cp -r lib/pkgconfig/* "${staging}/usr/lib/pkgconfig/"
|
|
|
|
for pc in "${staging}"/usr/lib/pkgconfig/*.pc; do
|
|
sed -i "s|^prefix=.*|prefix=${staging}/usr|" "$pc"
|
|
done
|
|
|
|
if [[ -d /usr/include/json ]] && [[ ! -e /usr/include/jsoncpp/json ]]; then
|
|
mkdir -p "${staging}/usr/include/jsoncpp"
|
|
ln -sf /usr/include/json "${staging}/usr/include/jsoncpp/json"
|
|
fi
|
|
}
|
|
|
|
build() {
|
|
local staging="${srcdir}/staging"
|
|
|
|
export PKG_CONFIG_PATH="${staging}/usr/lib/pkgconfig:${PKG_CONFIG_PATH:-}"
|
|
export LIBRARY_PATH="${staging}/usr/lib:${LIBRARY_PATH:-}"
|
|
export LD_LIBRARY_PATH="${staging}/usr/lib:${LD_LIBRARY_PATH:-}"
|
|
export CPATH="${staging}/usr/include:${CPATH:-}"
|
|
|
|
cd "${srcdir}/ipu7-camera-hal"
|
|
rm -rf build && mkdir -p build && cd build
|
|
cmake -DCMAKE_BUILD_TYPE=Release \
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
|
-DBUILD_CAMHAL_ADAPTOR=ON \
|
|
-DBUILD_CAMHAL_PLUGIN=ON \
|
|
-DIPU_VERSIONS="ipu75xa" \
|
|
-DUSE_STATIC_GRAPH=ON \
|
|
-DUSE_STATIC_GRAPH_AUTOGEN=ON \
|
|
-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
|
|
-DCMAKE_PREFIX_PATH="${staging}/usr" \
|
|
-DCMAKE_LIBRARY_PATH="${staging}/usr/lib" \
|
|
-DCMAKE_INCLUDE_PATH="${staging}/usr/include" \
|
|
..
|
|
make -j"$(nproc)"
|
|
|
|
make DESTDIR="${staging}" install
|
|
install -Dm644 "${srcdir}/ipu7-camera-hal/libcamhal.pc" \
|
|
"${staging}/usr/lib/pkgconfig/libcamhal.pc"
|
|
sed -i "s|^prefix=.*|prefix=${staging}/usr|" "${staging}/usr/lib/pkgconfig/libcamhal.pc"
|
|
|
|
cd "${srcdir}/icamerasrc"
|
|
export CHROME_SLIM_CAMHAL=ON
|
|
[[ ! -f configure ]] && ./autogen.sh
|
|
./configure --prefix=/usr
|
|
make -j"$(nproc)"
|
|
}
|
|
|
|
package() {
|
|
# DKMS: IPU7 drivers (ISYS + PSYS + ACPI)
|
|
local ipu7_dkms_dir="${pkgdir}/usr/src/ipu7-drivers-${pkgver}"
|
|
install -dm755 "${ipu7_dkms_dir}"
|
|
cp -r "${srcdir}/ipu7-drivers/"* "${ipu7_dkms_dir}/"
|
|
rm -rf "${ipu7_dkms_dir}/.git"
|
|
install -Dm644 "${srcdir}/dkms-ipu7-drivers.conf" "${ipu7_dkms_dir}/dkms.conf"
|
|
sed -i "s/@PKGVER@/${pkgver}/" "${ipu7_dkms_dir}/dkms.conf"
|
|
|
|
# DKMS: legacy Vision drivers (CVS misc driver), kernels before 7.2
|
|
local cvs_dkms_dir="${pkgdir}/usr/src/vision-drivers-${pkgver}"
|
|
install -dm755 "${cvs_dkms_dir}"
|
|
cp -r "${srcdir}/vision-drivers/"* "${cvs_dkms_dir}/"
|
|
install -Dm644 "${srcdir}/dkms-vision-drivers.conf" "${cvs_dkms_dir}/dkms.conf"
|
|
sed -i "s/@PKGVER@/${pkgver}/" "${cvs_dkms_dir}/dkms.conf"
|
|
|
|
# DKMS: in-tree Linux 7.2 Intel CVS V4L2 bridge driver, kernels 7.2+
|
|
local icvs_dkms_dir="${pkgdir}/usr/src/intel-cvs-${pkgver}"
|
|
install -Dm644 "${srcdir}/intel-cvs-core.c" "${icvs_dkms_dir}/core.c"
|
|
install -Dm644 "${srcdir}/intel-cvs-v4l2.c" "${icvs_dkms_dir}/v4l2.c"
|
|
install -Dm644 "${srcdir}/intel-cvs-icvs.h" "${icvs_dkms_dir}/icvs.h"
|
|
install -Dm644 "${srcdir}/intel-cvs-Makefile" "${icvs_dkms_dir}/Makefile"
|
|
install -Dm644 "${srcdir}/dkms-intel-cvs.conf" "${icvs_dkms_dir}/dkms.conf"
|
|
sed -i "s/@PKGVER@/${pkgver}/" "${icvs_dkms_dir}/dkms.conf"
|
|
|
|
# Firmware
|
|
install -dm755 "${pkgdir}/usr/lib/firmware/intel/ipu"
|
|
install -Dm644 "${srcdir}/ipu7-camera-bins/lib/firmware/intel/ipu/"*.bin \
|
|
-t "${pkgdir}/usr/lib/firmware/intel/ipu/"
|
|
|
|
# Proprietary libraries + headers from ipu7-camera-bins
|
|
cd "${srcdir}/ipu7-camera-bins"
|
|
install -dm755 "${pkgdir}/usr/lib"
|
|
cp -P lib/lib* "${pkgdir}/usr/lib/"
|
|
install -dm755 "${pkgdir}/usr/include"
|
|
cp -r include/* "${pkgdir}/usr/include/"
|
|
install -dm755 "${pkgdir}/usr/lib/pkgconfig"
|
|
cp -r lib/pkgconfig/* "${pkgdir}/usr/lib/pkgconfig/"
|
|
|
|
# Camera HAL + config
|
|
cd "${srcdir}/ipu7-camera-hal/build"
|
|
make DESTDIR="${pkgdir}" install
|
|
|
|
cd "${srcdir}/ipu7-camera-hal"
|
|
install -dm755 "${pkgdir}/usr/share/defaults/etc/camera"
|
|
install -Dm644 config/linux/ipu75xa/libcamhal_configs.json \
|
|
"${pkgdir}/usr/share/defaults/etc/camera/"
|
|
install -Dm644 config/linux/ipu75xa/*.aiqb \
|
|
-t "${pkgdir}/usr/share/defaults/etc/camera/"
|
|
|
|
install -dm755 "${pkgdir}/etc/camera/ipu75xa/gcss"
|
|
install -Dm644 config/linux/ipu75xa/gcss/*.bin \
|
|
-t "${pkgdir}/etc/camera/ipu75xa/gcss/"
|
|
|
|
install -dm755 "${pkgdir}/etc/camera/ipu75xa/sensors"
|
|
install -Dm644 config/linux/ipu75xa/sensors/*.json \
|
|
-t "${pkgdir}/etc/camera/ipu75xa/sensors/"
|
|
|
|
install -Dm644 config/linux/ipu75xa/pipe_scheduler_profiles.json \
|
|
"${pkgdir}/etc/camera/ipu75xa/"
|
|
install -Dm644 config/linux/ipu75xa/pnp_profiles.json \
|
|
"${pkgdir}/etc/camera/ipu75xa/"
|
|
|
|
# icamerasrc GStreamer plugin
|
|
cd "${srcdir}/icamerasrc"
|
|
make DESTDIR="${pkgdir}" install
|
|
|
|
# modprobe / modules-load
|
|
install -Dm644 "${srcdir}/camera-deps.conf" \
|
|
"${pkgdir}/usr/lib/modprobe.d/camera-deps.conf"
|
|
install -Dm644 "${srcdir}/v4l2loopback-modprobe.conf" \
|
|
"${pkgdir}/usr/lib/modprobe.d/v4l2loopback-camera.conf"
|
|
|
|
# systemd
|
|
install -Dm644 "${srcdir}/camera-init.service" \
|
|
"${pkgdir}/usr/lib/systemd/system/camera-init.service"
|
|
install -Dm644 "${srcdir}/intel-ipu7-camera.service" \
|
|
"${pkgdir}/usr/lib/systemd/system/intel-ipu7-camera.service"
|
|
|
|
# WirePlumber
|
|
install -Dm644 "${srcdir}/hide-ipu7-v4l2.conf" \
|
|
"${pkgdir}/usr/share/wireplumber/wireplumber.conf.d/hide-ipu7-v4l2.conf"
|
|
install -Dm644 "${srcdir}/disable-libcamera.conf" \
|
|
"${pkgdir}/usr/share/wireplumber/wireplumber.conf.d/disable-libcamera.conf"
|
|
|
|
# udev rules
|
|
install -Dm644 "${srcdir}/71-ipu7-hide-isys.rules" \
|
|
"${pkgdir}/usr/lib/udev/rules.d/71-ipu7-hide-isys.rules"
|
|
install -Dm644 "${srcdir}/90-ipu7-psys.rules" \
|
|
"${pkgdir}/usr/lib/udev/rules.d/90-ipu7-psys.rules"
|
|
|
|
# v4l2-relayd config for IPU7 camera
|
|
install -Dm644 "${srcdir}/v4l2-relayd-ipu7.conf" \
|
|
"${pkgdir}/etc/v4l2-relayd.d/ipu7.conf"
|
|
install -Dm644 "${srcdir}/v4l2-relayd-ipu7-override.conf" \
|
|
"${pkgdir}/etc/systemd/system/v4l2-relayd@ipu7.service.d/override.conf"
|
|
install -Dm644 "${srcdir}/camera-tmpfiles.conf" \
|
|
"${pkgdir}/usr/lib/tmpfiles.d/camera.conf"
|
|
install -Dm644 "${srcdir}/ov08x40.yaml" \
|
|
"${pkgdir}/usr/share/libcamera/ipa/simple/ov08x40.yaml"
|
|
|
|
# Sleep hook — staged here, installed to system-sleep by the .install scriptlet
|
|
install -Dm755 "${srcdir}/camera-sleep-hook" \
|
|
"${pkgdir}/usr/share/intel-ipu7-camera/camera-sleep-hook"
|
|
}
|