Add experimental libva/vaapi support

This commit is contained in:
BtbN 2021-07-14 00:24:28 +02:00
parent fe577307d2
commit 9cfcc851a2
4 changed files with 162 additions and 0 deletions

View file

@ -0,0 +1,19 @@
#!/bin/bash
XORGMACROS_REPO="https://gitlab.freedesktop.org/xorg/util/macros.git"
XORGMACROS_COMMIT="b8766308d2f78bc572abe5198007cf7aeec9b761"
ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1
return 0
}
ffbuild_dockerbuild() {
git-mini-clone "$XORGMACROS_REPO" "$XORGMACROS_COMMIT" xorg-macros
cd xorg-macros
autoreconf -i
./configure --prefix="/usr"
make -j"$(nproc)"
make install
}

View file

@ -0,0 +1,37 @@
#!/bin/bash
LIBPCIACCESS_REPO="https://gitlab.freedesktop.org/xorg/lib/libpciaccess.git"
LIBPCIACCESS_COMMIT="9c01fdd7c02d8b9b5003e659ebca0b3643bd47c4"
ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1
return 0
}
ffbuild_dockerbuild() {
git-mini-clone "$LIBPCIACCESS_REPO" "$LIBPCIACCESS_COMMIT" libpciaccess
cd libpciaccess
autoreconf -fi
local myconf=(
--prefix="$FFBUILD_PREFIX"
--disable-shared
--enable-static
--with-pic
--with-zlib
)
if [[ $TARGET == linux* ]]; then
myconf+=(
--host="$FFBUILD_TOOLCHAIN"
)
else
echo "Unknown target"
return -1
fi
./configure "${myconf[@]}"
make -j$(nproc)
make install
}

54
scripts.d/50-vaapi/40-libdrm.sh Executable file
View file

@ -0,0 +1,54 @@
#!/bin/bash
LIBDRM_REPO="https://gitlab.freedesktop.org/mesa/drm.git"
LIBDRM_COMMIT="9cef5dee3cd817728c83aeb3c2010c1954e4c402"
ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1
return 0
}
ffbuild_dockerbuild() {
git-mini-clone "$LIBDRM_REPO" "$LIBDRM_COMMIT" libdrm
cd libdrm
mkdir build && cd build
local myconf=(
--prefix="$FFBUILD_PREFIX"
-Ddefault_library=static
-Dlibkms=false
-Dudev=false
-Dcairo-tests=false
-Dvalgrind=false
-Dexynos=false
-Dfreedreno=false
-Domap=false
-Detnaviv=false
-Dintel=true
-Dnouveau=true
-Dradeon=true
-Damdgpu=true
)
if [[ $TARGET == linux* ]]; then
myconf+=(
--cross-file=/cross.meson
)
else
echo "Unknown target"
return -1
fi
meson "${myconf[@]}" ..
ninja -j$(nproc)
ninja install
}
ffbuild_configure() {
echo --enable-libdrm
}
ffbuild_unconfigure() {
echo --disable-libdrm
}

52
scripts.d/50-vaapi/50-libva.sh Executable file
View file

@ -0,0 +1,52 @@
#!/bin/bash
LIBVA_REPO="https://github.com/intel/libva.git"
LIBVA_COMMIT="6e86b4fb4dafa123b1e31821f61da88f10cfbe91"
ffbuild_enabled() {
[[ $TARGET != linux* ]] && return -1
return 0
}
ffbuild_dockerbuild() {
git-mini-clone "$LIBVA_REPO" "$LIBVA_COMMIT" libva
cd libva
autoreconf -i
local myconf=(
--prefix="$FFBUILD_PREFIX"
--disable-shared
--enable-static
--with-pic
--disable-docs
--enable-drm
--disable-x11
--disable-glx
--disable-wayland
)
if [[ $TARGET == linux64 ]]; then
myconf+=(
--host="$FFBUILD_TOOLCHAIN"
--with-drivers-path="/usr/lib/x86_64-linux-gnu/dri"
)
else
echo "Unknown target"
return -1
fi
./configure "${myconf[@]}"
make -j$(nproc)
make install
echo "Libs.private: -ldl" >> "$FFBUILD_PREFIX"/lib/pkgconfig/libva.pc
}
ffbuild_configure() {
echo --enable-vaapi
}
ffbuild_unconfigure() {
echo --disable-vaapi
}