From 5677557cca705199f66d3ef2327682353ab3a256 Mon Sep 17 00:00:00 2001 From: Sylvain Pineau Date: Tue, 23 Jan 2018 13:26:14 +0100 Subject: bin:graphics_env: No need to set provider on AMD DRI3 config Base on https://wiki.archlinux.org/index.php/PRIME, there is a note describing as following: Note: This setting (xrandr --setprovideroffloadsink provider sink) is no longer necessary when using the default intel/modesetting driver from the official repos, as they have DRI3 enabled by default and will therefore automatically make these assignments. Fixes: lp:1717204 --- bin/graphics_env | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/graphics_env b/bin/graphics_env index 8c82567..9511560 100755 --- a/bin/graphics_env +++ b/bin/graphics_env @@ -19,9 +19,11 @@ if [[ $DRIVER == "amdgpu" || $DRIVER == "radeon" ]]; then if [ $INDEX -gt 1 ]; then # See https://wiki.archlinux.org/index.php/PRIME echo "Setting up PRIME GPU offloading for AMD discrete GPU" - PROVIDER_ID=`xrandr --listproviders | grep "Sink Output" | awk {'print $4'} | tail -1` - SINK_ID=`xrandr --listproviders | grep "Source Output" | awk {'print $4'} | tail -1` - xrandr --setprovideroffloadsink ${PROVIDER_ID} ${SINK_ID} + if ! grep -q DRI3 /var/log/Xorg.0.log; then + PROVIDER_ID=`xrandr --listproviders | grep "Sink Output" | awk {'print $4'} | tail -1` + SINK_ID=`xrandr --listproviders | grep "Source Output" | awk {'print $4'} | tail -1` + xrandr --setprovideroffloadsink ${PROVIDER_ID} ${SINK_ID} + fi export DRI_PRIME=1 else export DRI_PRIME= -- cgit v1.2.3