set LIBVA_DRIVER_NAME for arch
Signed-off-by: Naman Sood <mail@nsood.in>
This commit is contained in:
parent
a742bebe3d
commit
5215868d3d
1 changed files with 18 additions and 0 deletions
18
zprofile
18
zprofile
|
@ -15,3 +15,21 @@ fi
|
|||
export PKGEXT=".pkg.tar"
|
||||
|
||||
export TENDS_TO=42
|
||||
|
||||
DISTRO=$(cat /etc/os-release | grep '^ID=' | awk -F'=' '{print $2}')
|
||||
|
||||
if [ $DISTRO = 'arch' ]; then
|
||||
# configure VA-API for hardware video acceleration
|
||||
VIDEO_DRIVERS=($(ls /usr/lib/dri | grep drv_video | awk -F_ '{print $1}'))
|
||||
VIDEO_DRIVERS_LEN=${#VIDEO_DRIVERS[@]}
|
||||
|
||||
if [ $VIDEO_DRIVERS_LEN -eq 1 ]; then
|
||||
export LIBVA_DRIVER_NAME=$VIDEO_DRIVERS
|
||||
elif [ $VIDEO_DRIVERS_LEN -gt 1 ]; then
|
||||
if [ ! -v $LIBVA_DRIVER_NAME]; then
|
||||
echo "Warning: more than one VA-API driver detected! Found: ${VIDEO_DRIVERS}." >&2
|
||||
echo "Either delete the wrong driver or choose one manually by setting LIBVA_DRIVER_NAME." >&2
|
||||
fi
|
||||
fi
|
||||
export LC_ALL=C
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue