diff options
-rw-r--r-- | core/modules/xorg/data/etc/X11/Xsession.d/10-fix-vmware-3d | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/core/modules/xorg/data/etc/X11/Xsession.d/10-fix-vmware-3d b/core/modules/xorg/data/etc/X11/Xsession.d/10-fix-vmware-3d index eebf51d3..e9951eb3 100644 --- a/core/modules/xorg/data/etc/X11/Xsession.d/10-fix-vmware-3d +++ b/core/modules/xorg/data/etc/X11/Xsession.d/10-fix-vmware-3d @@ -1,26 +1,25 @@ #!/bin/ash # ^ sourced -# This is required for Mesa 20.0+ for now. Starting from this version, +# This is required for Mesa 20.x for now. Starting from this version, # the new "Iris" OpenGL driver has been made default for intel Gen8 # and newer, which unfortunately completely breaks 3D acceleration with # VMware 15.5.6 (as of 2020-08-04 with Mesa 20.0 + Ubuntu 20.04 as base) +# and causes severe glitches with qemu und GVT-g +# This bug seems to be fixed in Mesa 21.x + +test_file="/usr/lib/x86_64-linux-gnu/dri/iris_dri.so" +[ -s "$test_file" ] || return 0 # Driver not present, do nothing +# Get version +mesa_version=$( grep -aoPm1 '(?<=Mesa version )[0-9]{2}\.[0-9]' "$test_file" ) +[ -z "$mesa_version" ] && mesa_version=$( grep -aoPm1 '(?<=Mesa )[0-9]{2}\.[0-9]' "$test_file" ) +mesa_version="${mesa_version%.*}" +[ -z "$mesa_version" ] && return 0 # No version extracted, do nothing +[ "$mesa_version" -gt 20 ] && return 0 # Version > 20, bug fixed + +# <= 20.x with iris driver present, enable workaround for glitches +export INTEL_DEBUG=norbc +unset mesa_version test_file -drivers="$( grep -Po '(?<=modules/drivers/)\S+(?=_drv\.so)' /var/log/Xorg.0.log )" -intel=false -other=false -for driver in $drivers; do - case "$driver" in - ati|amdgpu|nvidia|nouveau|vmware) - other=true - ;; - intel) - intel=true - ;; - esac -done -if $intel && ! $other; then - export MESA_LOADER_DRIVER_OVERRIDE=i965 -fi true |