site  contact  subhomenews

Hack for special Intel GPUs

February 09, 2020 — BarryK

There are two main problems with Intel GPUs: the Xorg 'modesetting' driver may crash, and when using the 'intel' driver, the default 'sna' acceleration may cause trouble, even hanging. Xorg is not always clever enough to choose what works best.

Puppy Forum member 'norgo' posted detection to use uxa acceleration for certain GPUs. This is intended for committing to Woof-CE:

http://murga-linux.com/puppy/viewtopic.php?p=1048213#1048213

The handling of video in woof-CE has diverged considerably from that in WoofQ. For example, WoofQ has video hardware profiling:

https://bkhome.org/news/202001/further-improved-video-hardware-profiling.html

My laptop, with 8086:5a85 Intel GPU, is one of those where the 'modesetting' driver crashes, and the 'intel' driver is more stable with 'uxa' acceleration.  Norgo has identified 8086:0412, 8086:2562 and 8086:27a2 GPUs as needing 'uxa' acceleration.

I did have /etc/rc.d/rc.hacks, called from rc.sysinit, to handle the case of my laptop, however, this is clumsy and I have removed that script.

Instead, /usr/bin/xwin, which starts Xorg, calls new script /usr/sbin/xorg-gpu-hacks

This integrates nicely with the video hardware profiling. Here is the new code in 'xwin':

#200209 need a hack for some intel gpu's...
#have renamed 20-intel-* files to 20-gpu-intel*, so delete the old ones (existing installation)...
rm -f /etc/X11/xorg.conf.d/20-intel-* 2>/dev/null
rm -f /etc/X11/xorg.conf.d/intel-gpu*.conf 2>/dev/null
. /etc/X11/xorg.conf.d/PuppyHardwareProfile #has variable PuppyHardwareProfile
#i was doing this in rc.hacks, called from rc.sysinit, but now do here...
#if xorgwizard-cli or xorgwizard-automatic have not created a /etc/X11/xorg.conf.d/20-gpu-*.conf
#(or it was created manually), apply any required hack here (ex: force uxa accel for intel)...
ls -1 /etc/X11/xorg.conf.d/20-gpu-*.conf >/dev/null 2>&1
if [ $? -ne 0 ];then
#no pre-existing 20-gpu-*.conf, so apply hack script...
HARDWAREPROFILE="${PuppyHardwareProfile}" /usr/sbin/xorg-gpu-hacks
fi

Here is the content of 'xorg-gpu-hacks':

#!/bin/ash
#called from /usr/bin/xwin, only if no /etc/X11/xorg.conf.d/20-gpu-*.conf
#this hack was originally /etc/rc.d/rc.hacks called from rc.sysinit -- removed.
#variable HARDWAREPROFILE is exported to here.
#200209 first version.

#format of HARDWAREPROFILE is id1_[id2_]+edidsum, ex: 8086:0102_+958937616
#FUTURE: think about multiple gpu's
#note, this is how to find a particular gpu: lspci -n -d 8086:5a85:0300

#forum member norgo has identified some intel chips that require uxa: 0412 2562 27a2
# http://murga-linux.com/puppy/viewtopic.php?p=1048213#1048213
#5a85 is my apollo lake laptop, intel gpu, crashes with modesetting driver, prefers uxa instead of sna.

case "$HARDWAREPROFILE" in
8086:5a85*|8086:0412*|8086:2562*|8086:27a2*)
if [ ! -f /etc/X11/xorg.conf.d/20-gpu-intel.conf ];then
cp -a /etc/X11/xorg.conf.d/20-gpu-intel.confUXA /etc/X11/xorg.conf.d/20-gpu-intel.conf
fi
;;
8086:*)
true
;;
*) #precaution...
[ -f /etc/X11/xorg.conf.d/20-gpu-intel.conf ] && rm -f /etc/X11/xorg.conf.d/20-gpu-intel.conf
;;
esac

It is looking good, yet to be tested. 

Tags: easy