diff options
author | Sylvain Pineau <sylvain.pineau@canonical.com> | 2018-01-23 13:26:14 +0100 |
---|---|---|
committer | Sylvain Pineau <sylvain.pineau@canonical.com> | 2018-01-23 13:26:14 +0100 |
commit | 5677557cca705199f66d3ef2327682353ab3a256 (patch) | |
tree | 30614216c282832895bbb289705ec9038aeaf4e5 | |
parent | 40e72610eb570c6111643c0eeeaa9eb334d5c1dd (diff) |
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
-rwxr-xr-x | bin/graphics_env | 8 |
1 files 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= |