Add vgaswitcheroo support

This commit is contained in:
Kolan Sh 2012-04-07 01:28:12 -04:00
parent d064701c19
commit 7ba3e230ae
2 changed files with 172 additions and 162 deletions

View File

@ -4,7 +4,11 @@ model=`dmidecode $@ -s system-product-name`
let retry=8
while [ 0 -lt $retry ]; do
if [ -f /sys/kernel/debug/vgaswitcheroo/switch ]; then
modprobe -r nvidia \
&& echo 'OFF DIS' > /sys/kernel/debug/vgaswitcheroo/switch \
&& exit 0
else
case "$model" in
M11XR2)
modprobe -r nvidia \
@ -85,6 +89,7 @@ while [ 0 -lt $retry ]; do
*) echo "Snail: unknown Notebook model: $model"; exit -1
;;
esac
fi
sleep 0.2
let retry--

View File

@ -4,7 +4,11 @@ model=`dmidecode $@ -s system-product-name`
let retry=8
while [ 0 -lt $retry ]; do
if [ -f /sys/kernel/debug/vgaswitcheroo/switch ]; then
echo 'ON DIS' > /sys/kernel/debug/vgaswitcheroo/switch \
&& modprobe nvidia \
&& exit 0
else
case "$model" in
M11XR2)
echo '\_SB.PCI0.P0P2.PEGP._PS0' > /proc/acpi/call \
@ -85,6 +89,7 @@ while [ 0 -lt $retry ]; do
*) echo "Snail: unknown Notebook model: $model"; exit -1
;;
esac
fi
sleep 0.01
let retry--