From 5527d37de6da75c7ed8a619519e0962e8c785a00 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 15 Nov 2021 17:08:27 +0100 Subject: [xorg] iris driver workaround: Only required for Mesa 20.x 21.x apparently fixed all the issues that appeared with the iris driver and hardware acceleration. Check for Mesa 20 specifically. Also use a more refined workaround by setting an env-var that only affects the iris driver, which saves us from checking which driver appears to be in use by grepping the Xorg log file. --- .../xorg/data/etc/X11/Xsession.d/10-fix-vmware-3d | 33 +++++++++++----------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'core/modules/xorg') 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 -- cgit v1.2.3-55-g7522