diff --git a/.github/workflows/debian.yml b/.github/workflows/debian.yml new file mode 100644 index 0000000..a43932d --- /dev/null +++ b/.github/workflows/debian.yml @@ -0,0 +1,83 @@ +name: Debian packages + +on: + push: + branches: ['**'] + tags: ['v*'] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-24.04-arm + strategy: + fail-fast: false + matrix: + include: + - suite: trixie + image: debian:trixie + - suite: noble + image: ubuntu:noble + - suite: resolute + image: ubuntu:resolute + container: ${{ matrix.image }} + env: + DEBIAN_FRONTEND: noninteractive + steps: + - name: Install packaging tools + run: | + apt-get update + apt-get install -y --no-install-recommends ca-certificates git build-essential devscripts equivs lintian + - uses: actions/checkout@v4 + - name: Install build dependencies + run: mk-build-deps --install --remove --tool 'apt-get -y --no-install-recommends' debian/control + - name: Build binary packages + env: + SUITE: ${{ matrix.suite }} + run: | + version=$(dpkg-parsechangelog -S Version) + if [ "$GITHUB_REF_TYPE" = tag ]; then + test "$GITHUB_REF_NAME" = "v$version" + fi + DEBFULLNAME='libva-v4l2 CI' DEBEMAIL='noreply@github.com' \ + dch --newversion "$version+$SUITE" --distribution "$SUITE" 'Build for the target distribution.' + dpkg-buildpackage -us -uc -b + mkdir -p artifacts + for artifact in ../*.deb ../*.ddeb ../*.buildinfo ../*.changes; do + if [ -f "$artifact" ]; then + cp "$artifact" artifacts/ + fi + done + - name: Inspect packages + run: | + lintian --fail-on error artifacts/*.changes + dpkg-deb --contents artifacts/libva-v4l2_*.deb + apt-get install -y ./artifacts/libva-v4l2_*.deb + test "$(readlink /usr/lib/aarch64-linux-gnu/dri/msm_drv_video.so)" = v4l2_drv_video.so + cmp packaging/environment/60-libva-v4l2.conf /usr/lib/environment.d/60-libva-v4l2.conf + cmp packaging/environment/libva-v4l2.sh /etc/profile.d/libva-v4l2.sh + - uses: actions/upload-artifact@v4 + with: + name: libva-v4l2-${{ matrix.suite }}-arm64 + path: artifacts/* + if-no-files-found: error + + release: + if: startsWith(github.ref, 'refs/tags/v') + needs: build + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - uses: actions/download-artifact@v4 + with: + pattern: libva-v4l2-*-arm64 + path: artifacts + merge-multiple: true + - uses: softprops/action-gh-release@v2 + with: + draft: true + files: artifacts/* diff --git a/.gitignore b/.gitignore index 03eaefb..d66ec3f 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,13 @@ __pycache__/ /packaging/arch/pkg/ /packaging/arch/*.tar.gz /packaging/arch/*.pkg.tar.zst + +# Debian packaging artifacts. +/obj-*/ +/debian/.debhelper/ +/debian/libva-v4l2/ +/debian/*.debhelper +/debian/*.substvars +/debian/files +/artifacts/ +/*-build-deps_*.deb diff --git a/README.md b/README.md index 8e139a5..4764718 100644 --- a/README.md +++ b/README.md @@ -82,8 +82,9 @@ meson compile -C build sudo meson install -C build ``` -FastCV VPP defaults to `-Dfastcv=auto` (enabled when dependencies are available). -Use `-Dfastcv=disabled` to disable it or `-Dfastcv=enabled` to require build dependencies. +FastCV VPP defaults to `-Dfastcv=disabled`. Use `-Dfastcv=auto` to enable it +when dependencies are available or `-Dfastcv=enabled` to require build dependencies. +Debian / Ubuntu packages explicitly disable FastCV for consistent distribution builds. FastCV is loaded dynamically; missing runtime libraries disable only VPP. Adjust `libdir` if your system uses a driver directory other than `/usr/lib/dri`. diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..e5f372f --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +libva-v4l2 (0.1.0-1) unstable; urgency=medium + + * Initial Debian packaging for RadxaOS. + * Disable FastCV and retain GStreamer VA session configuration. + + -- Xilin Wu Thu, 10 Sep 2026 16:00:00 +0800 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..5d7a09f --- /dev/null +++ b/debian/control @@ -0,0 +1,23 @@ +Source: libva-v4l2 +Section: video +Priority: optional +Maintainer: Xilin Wu +Build-Depends: debhelper-compat (= 13), meson (>= 0.61), ninja-build, pkg-config, + libva-dev, libdrm-dev, libegl-dev, libgles-dev, libgbm-dev +Standards-Version: 4.7.0 +Rules-Requires-Root: no +Homepage: https://github.com/strongtz/libva-v4l2 +Vcs-Git: https://github.com/strongtz/libva-v4l2.git +Vcs-Browser: https://github.com/strongtz/libva-v4l2 + +Package: libva-v4l2 +Architecture: arm64 +Depends: ${shlibs:Depends}, ${misc:Depends} +Provides: va-driver +Description: VA-API backend for Qualcomm Iris stateful V4L2 devices + Hardware video decoding and H.264/HEVC encoding through the Qualcomm Iris + stateful V4L2 M2M interface. This experimental driver targets SC8280XP, + including Radxa Dragon Q8B, and requires a compatible kernel and firmware. + . + Includes the MSM driver alias and GStreamer VA environment configuration. + FastCV video processing is disabled in distribution builds. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..cd37ae4 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,31 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: libva-v4l2 +Source: https://github.com/strongtz/libva-v4l2 + +Files: * +Copyright: 2026 libva-v4l2 contributors +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + . + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + . + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + +Files: patches/* +Copyright: 2026 Xilin Wu + Linux kernel contributors +License: GPL-2.0-only + On Debian systems the full text of the GNU General Public License version 2 + can be found in /usr/share/common-licenses/GPL-2. diff --git a/debian/install b/debian/install new file mode 100644 index 0000000..5dfe52c --- /dev/null +++ b/debian/install @@ -0,0 +1,2 @@ +packaging/environment/60-libva-v4l2.conf usr/lib/environment.d +packaging/environment/libva-v4l2.sh etc/profile.d diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..e0c51ea --- /dev/null +++ b/debian/rules @@ -0,0 +1,13 @@ +#!/usr/bin/make -f + +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + +%: + dh $@ --buildsystem=meson + +override_dh_auto_configure: + dh_auto_configure -- -Dfastcv=disabled + +override_dh_auto_install: + dh_auto_install + rm -rf debian/libva-v4l2/usr/share/licenses diff --git a/debian/source/format b/debian/source/format new file mode 100644 index 0000000..163aaf8 --- /dev/null +++ b/debian/source/format @@ -0,0 +1 @@ +3.0 (quilt) diff --git a/meson_options.txt b/meson_options.txt index b62400f..2fb21c1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1 +1 @@ -option('fastcv', type: 'feature', value: 'auto', description: 'VA-API scaling with FastCV on CDSP') +option('fastcv', type: 'feature', value: 'disabled', description: 'VA-API scaling with FastCV on CDSP') diff --git a/packaging/environment/60-libva-v4l2.conf b/packaging/environment/60-libva-v4l2.conf new file mode 100644 index 0000000..da3cc2c --- /dev/null +++ b/packaging/environment/60-libva-v4l2.conf @@ -0,0 +1,2 @@ +GST_VA_ALL_DRIVERS=1 +GST_PLUGIN_FEATURE_RANK=vah264dec:1000,vah264enc:1000,vah265dec:1000,vah265enc:1000,vavp9dec:1000 diff --git a/packaging/environment/libva-v4l2.sh b/packaging/environment/libva-v4l2.sh new file mode 100644 index 0000000..101c555 --- /dev/null +++ b/packaging/environment/libva-v4l2.sh @@ -0,0 +1,2 @@ +export GST_VA_ALL_DRIVERS=1 +export GST_PLUGIN_FEATURE_RANK=vah264dec:1000,vah264enc:1000,vah265dec:1000,vah265enc:1000,vavp9dec:1000