From 937bead22a7c2830355556733bfe623adc7e1eda Mon Sep 17 00:00:00 2001 From: "Ward Nakchbandi (Cosmic Fusion)" <83735213+CosmicFusion@users.noreply.github.com> Date: Sat, 30 Sep 2023 10:55:03 +0300 Subject: [PATCH] --- debian/changelog | 2 +- debian/control | 2 +- debian/env-scripts/20-nvd-moz | 2 ++ debian/env-scripts/nvidia-vaapi-env.sh | 15 +++++++++++---- debian/rules | 2 ++ 5 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 debian/env-scripts/20-nvd-moz diff --git a/debian/changelog b/debian/changelog index f181df9..62924ad 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -nvidia-vaapi-driver (10:0.0.10-100pika1) pikauwu; urgency=medium +nvidia-vaapi-driver (10:0.0.10-100pika2) pikauwu; urgency=medium * Update to pikauwu diff --git a/debian/control b/debian/control index 8da299e..c045739 100644 --- a/debian/control +++ b/debian/control @@ -16,7 +16,7 @@ Rules-Requires-Root: no Package: nvidia-vaapi-driver Architecture: any Multi-Arch: same -Depends: ${misc:Depends}, ${shlibs:Depends} +Depends: ${misc:Depends}, ${shlibs:Depends}, switcheroo-control Suggests: libcuda1 Description: VA-API implementation that uses NVDEC as a backend nvidia-vaapi-driver is an VA-API(Video Acceleration API) diff --git a/debian/env-scripts/20-nvd-moz b/debian/env-scripts/20-nvd-moz new file mode 100644 index 0000000..ba798ab --- /dev/null +++ b/debian/env-scripts/20-nvd-moz @@ -0,0 +1,2 @@ +# Enable X11 EGL in firefox in order for it to use nvidia-vaapi-driver +export MOZ_X11_EGL=1 \ No newline at end of file diff --git a/debian/env-scripts/nvidia-vaapi-env.sh b/debian/env-scripts/nvidia-vaapi-env.sh index 0b91e22..5c8ceed 100755 --- a/debian/env-scripts/nvidia-vaapi-env.sh +++ b/debian/env-scripts/nvidia-vaapi-env.sh @@ -6,9 +6,16 @@ nvkernmod=$(lspci -k | grep -iEA3 '^[[:alnum:]]{2}:[[:alnum:]]{2}.*VGA|3D|DISPLA if [[ ! -z $nvkernmod ]] then -export LIBVA_DRIVER_NAME=nvidia -export MOZ_DISABLE_RDD_SANDBOX=1 -export NVD_BACKEND=direct -export EGL_PLATFORM=$XDG_SESSION_TYPE + if switcherooctl list | awk 'ORS = $1 ~/Name/ ? " " : "\n"' | grep Default | grep yes | grep -E -i 'intel|amd|radeon|advanced' > /dev/null 2>&1 + then + export MOZ_DISABLE_RDD_SANDBOX=1 + export NVD_BACKEND=direct + export EGL_PLATFORM=$XDG_SESSION_TYPE + else + export LIBVA_DRIVER_NAME=nvidia + export MOZ_DISABLE_RDD_SANDBOX=1 + export NVD_BACKEND=direct + export EGL_PLATFORM=$XDG_SESSION_TYPE + fi fi diff --git a/debian/rules b/debian/rules index a3abdfb..58db983 100755 --- a/debian/rules +++ b/debian/rules @@ -9,3 +9,5 @@ override_dh_install: dh_install mkdir -p debian/nvidia-vaapi-driver/etc/profile.d cp debian/env-scripts/nvidia-vaapi-env.sh debian/nvidia-vaapi-driver/etc/profile.d/ + mkdir -p debian/nvidia-vaapi-driver/etc/X11/Xsession.d/ + cp debian/env-scripts/20-nvd-moz debian/nvidia-vaapi-driver/etc/X11/Xsession.d/