Add vgaswitcheroo support
This commit is contained in:
parent
d064701c19
commit
7ba3e230ae
|
@ -4,87 +4,92 @@ model=`dmidecode $@ -s system-product-name`
|
||||||
|
|
||||||
let retry=8
|
let retry=8
|
||||||
while [ 0 -lt $retry ]; do
|
while [ 0 -lt $retry ]; do
|
||||||
|
if [ -f /sys/kernel/debug/vgaswitcheroo/switch ]; then
|
||||||
case "$model" in
|
modprobe -r nvidia \
|
||||||
M11XR2)
|
&& echo 'OFF DIS' > /sys/kernel/debug/vgaswitcheroo/switch \
|
||||||
modprobe -r nvidia \
|
&& exit 0
|
||||||
&& echo '\_SB.PCI0.P0P2.PEGP.NVOP 0 0x100 0x1A {255,255,255,255}' > /proc/acpi/call \
|
else
|
||||||
&& echo '\_SB.PCI0.P0P2.PEGP._PS3' > /proc/acpi/call \
|
case "$model" in
|
||||||
&& exit 0
|
M11XR2)
|
||||||
;;
|
modprobe -r nvidia \
|
||||||
1015PN)
|
&& echo '\_SB.PCI0.P0P2.PEGP.NVOP 0 0x100 0x1A {255,255,255,255}' > /proc/acpi/call \
|
||||||
modprobe -r nvidia \
|
&& echo '\_SB.PCI0.P0P2.PEGP._PS3' > /proc/acpi/call \
|
||||||
&& echo '\OSGS 0x03' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
1015PN)
|
||||||
1215N)
|
modprobe -r nvidia \
|
||||||
modprobe -r nvidia \
|
&& echo '\OSGS 0x03' > /proc/acpi/call \
|
||||||
&& echo '\_SB.PCI0.P0P4.GFX0._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& echo '\_SB.PCI0.P0P4.GFX0._PS3' > /proc/acpi/call \
|
;;
|
||||||
&& exit 0
|
1215N)
|
||||||
;;
|
modprobe -r nvidia \
|
||||||
K42Jc|K52Jc|N53Jf|N53Jg|N71Jv|N73Jf|P52Jc|PL80Jt|U30Jc|U33Jc|U35Jc|U36Jc|UL80Jt)
|
&& echo '\_SB.PCI0.P0P4.GFX0._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}' > /proc/acpi/call \
|
||||||
modprobe -r nvidia \
|
&& echo '\_SB.PCI0.P0P4.GFX0._PS3' > /proc/acpi/call \
|
||||||
&& echo '\_SB.PCI0.PEG1.GFX0.DOFF' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
K42Jc|K52Jc|N53Jf|N53Jg|N71Jv|N73Jf|P52Jc|PL80Jt|U30Jc|U33Jc|U35Jc|U36Jc|UL80Jt)
|
||||||
N61Jv|N73Sv)
|
modprobe -r nvidia \
|
||||||
modprobe -r nvidia \
|
&& echo '\_SB.PCI0.PEG1.GFX0.DOFF' > /proc/acpi/call \
|
||||||
&& echo '\_SB.PCI0.PEGR.GFX0.DOFF' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
N61Jv|N73Sv)
|
||||||
P31Jg)
|
modprobe -r nvidia \
|
||||||
modprobe -r nvidia \
|
&& echo '\_SB.PCI0.PEGR.GFX0.DOFF' > /proc/acpi/call \
|
||||||
&& echo '\_SB.PCI0.PEG1.GFX0._PS3' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
P31Jg)
|
||||||
U43Jc)
|
modprobe -r nvidia \
|
||||||
modprobe -r nvidia \
|
&& echo '\_SB.PCI0.PEG1.GFX0._PS3' > /proc/acpi/call \
|
||||||
&& echo '\_SB.PCI0.RP00.VGA._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& echo '\_SB.PCI0.RP00.VGA._PS3' > /proc/acpi/call \
|
;;
|
||||||
&& exit 0
|
U43Jc)
|
||||||
;;
|
modprobe -r nvidia \
|
||||||
UL30Vt)
|
&& echo '\_SB.PCI0.RP00.VGA._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}' > /proc/acpi/call \
|
||||||
modprobe -r nvidia \
|
&& echo '\_SB.PCI0.RP00.VGA._PS3' > /proc/acpi/call \
|
||||||
&& echo '\_SB.PCI0.P0P1.VGA._OFF' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
UL30Vt)
|
||||||
E6420)
|
modprobe -r nvidia \
|
||||||
modprobe -r nvidia \
|
&& echo '\_SB.PCI0.P0P1.VGA._OFF' > /proc/acpi/call \
|
||||||
&& echo '\_SB.PCI0.PEG0.VID._OFF' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
E6420)
|
||||||
InspironN5110|XPSL702X)
|
modprobe -r nvidia \
|
||||||
modprobe -r nvidia \
|
&& echo '\_SB.PCI0.PEG0.VID._OFF' > /proc/acpi/call \
|
||||||
&& echo '\_SB.PCI0.PEG0.PEGP._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& echo '\_SB.PCI0.PEG0.PEGP._PS3' > /proc/acpi/call \
|
;;
|
||||||
&& exit 0
|
InspironN5110|XPSL702X)
|
||||||
;;
|
modprobe -r nvidia \
|
||||||
Vostro3300|Vostro3500)
|
&& echo '\_SB.PCI0.PEG0.PEGP._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}' > /proc/acpi/call \
|
||||||
modprobe -r nvidia \
|
&& echo '\_SB.PCI0.PEG0.PEGP._PS3' > /proc/acpi/call \
|
||||||
&& echo '\_SB.PCI0.P0P1.PEGP._OFF' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
Vostro3300|Vostro3500)
|
||||||
XPS15)
|
modprobe -r nvidia \
|
||||||
modprobe -r nvidia \
|
&& echo '\_SB.PCI0.P0P1.PEGP._OFF' > /proc/acpi/call \
|
||||||
&& echo '\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
XPS15)
|
||||||
ThinkPadT410)
|
modprobe -r nvidia \
|
||||||
modprobe -r nvidia \
|
&& echo '\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call \
|
||||||
&& echo '\_SB.PCI0.PEG.VID._PS3' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& echo '\_SB.PCI0.PEG.VID._OFF' > /proc/acpi/call \
|
;;
|
||||||
&& exit 0
|
ThinkPadT410)
|
||||||
;;
|
modprobe -r nvidia \
|
||||||
ThinkPadT420)
|
&& echo '\_SB.PCI0.PEG.VID._PS3' > /proc/acpi/call \
|
||||||
modprobe -r nvidia \
|
&& echo '\_SB.PCI0.PEG.VID._OFF' > /proc/acpi/call \
|
||||||
&& echo '\_SB.PCI0.PEG.VID._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& echo '\_SB.PCI0.PEG.VID._PS3' > /proc/acpi/call \
|
;;
|
||||||
&& exit 0
|
ThinkPadT420)
|
||||||
;;
|
modprobe -r nvidia \
|
||||||
*) echo "Snail: unknown Notebook model: $model"; exit -1
|
&& echo '\_SB.PCI0.PEG.VID._DSM {0xF8,0xD8,0x86,0xA4,0xDA,0x0B,0x1B,0x47,0xA7,0x2B,0x60,0x42,0xA6,0xB5,0xBE,0xE0} 0x100 0x1A {0x1,0x0,0x0,0x3}' > /proc/acpi/call \
|
||||||
;;
|
&& echo '\_SB.PCI0.PEG.VID._PS3' > /proc/acpi/call \
|
||||||
esac
|
&& exit 0
|
||||||
|
;;
|
||||||
|
*) echo "Snail: unknown Notebook model: $model"; exit -1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
sleep 0.2
|
sleep 0.2
|
||||||
let retry--
|
let retry--
|
||||||
|
|
|
@ -4,87 +4,92 @@ model=`dmidecode $@ -s system-product-name`
|
||||||
|
|
||||||
let retry=8
|
let retry=8
|
||||||
while [ 0 -lt $retry ]; do
|
while [ 0 -lt $retry ]; do
|
||||||
|
if [ -f /sys/kernel/debug/vgaswitcheroo/switch ]; then
|
||||||
case "$model" in
|
echo 'ON DIS' > /sys/kernel/debug/vgaswitcheroo/switch \
|
||||||
M11XR2)
|
&& modprobe nvidia \
|
||||||
echo '\_SB.PCI0.P0P2.PEGP._PS0' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& modprobe nvidia \
|
else
|
||||||
&& exit 0
|
case "$model" in
|
||||||
;;
|
M11XR2)
|
||||||
1015PN)
|
echo '\_SB.PCI0.P0P2.PEGP._PS0' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.P0P4.DGPU.DON' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
1015PN)
|
||||||
1215N)
|
echo '\_SB.PCI0.P0P4.DGPU.DON' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.P0P4.GFX0._PS0' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
1215N)
|
||||||
K42Jc|K52Jc|N53Jf|N53Jg|N71Jv|N73Jf|P52Jc|PL80Jt|U30Jc|U33Jc|U35Jc|U36Jc|UL80Jt)
|
echo '\_SB.PCI0.P0P4.GFX0._PS0' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.PEG1.GFX0.DON' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
K42Jc|K52Jc|N53Jf|N53Jg|N71Jv|N73Jf|P52Jc|PL80Jt|U30Jc|U33Jc|U35Jc|U36Jc|UL80Jt)
|
||||||
N53Sn|U41Sv|N53Sv)
|
echo '\_SB.PCI0.PEG1.GFX0.DON' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.PEG0.GFX0.DON' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
N53Sn|U41Sv|N53Sv)
|
||||||
N61Jv|N73Sv)
|
echo '\_SB.PCI0.PEG0.GFX0.DON' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.PEGR.GFX0.DON' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
N61Jv|N73Sv)
|
||||||
P31Jg)
|
echo '\_SB.PCI0.PEGR.GFX0.DON' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.PEG1.GFX0._PS0' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
P31Jg)
|
||||||
U43Jc)
|
echo '\_SB.PCI0.PEG1.GFX0._PS0' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.RP00.VGA._PS0' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
U43Jc)
|
||||||
UL30Vt)
|
echo '\_SB.PCI0.RP00.VGA._PS0' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.P0P1.VGA._ON' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
UL30Vt)
|
||||||
E6420)
|
echo '\_SB.PCI0.P0P1.VGA._ON' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.PEG0.VID._ON' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
E6420)
|
||||||
InspironN5110|XPSL702X)
|
echo '\_SB.PCI0.PEG0.VID._ON' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.PEG0.PEGP._PS0' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
InspironN5110|XPSL702X)
|
||||||
Vostro3300|Vostro3500)
|
echo '\_SB.PCI0.PEG0.PEGP._PS0' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.P0P1.PEGP._ON' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
Vostro3300|Vostro3500)
|
||||||
XPS15)
|
echo '\_SB.PCI0.P0P1.PEGP._ON' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.PEG0.PEGP._ON' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
XPS15)
|
||||||
ThinkPadT410)
|
echo '\_SB.PCI0.PEG0.PEGP._ON' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.PEG.VID._ON' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& echo '\_SB.PCI0.PEG.VID._PS0' > /proc/acpi/call \
|
&& exit 0
|
||||||
&& modprobe nvidia \
|
;;
|
||||||
&& exit 0
|
ThinkPadT410)
|
||||||
;;
|
echo '\_SB.PCI0.PEG.VID._ON' > /proc/acpi/call \
|
||||||
ThinkPadT420)
|
&& echo '\_SB.PCI0.PEG.VID._PS0' > /proc/acpi/call \
|
||||||
echo '\_SB.PCI0.PEG.VID._PS0' > /proc/acpi/call \
|
&& modprobe nvidia \
|
||||||
&& modprobe nvidia \
|
&& exit 0
|
||||||
&& exit 0
|
;;
|
||||||
;;
|
ThinkPadT420)
|
||||||
*) echo "Snail: unknown Notebook model: $model"; exit -1
|
echo '\_SB.PCI0.PEG.VID._PS0' > /proc/acpi/call \
|
||||||
;;
|
&& modprobe nvidia \
|
||||||
esac
|
&& exit 0
|
||||||
|
;;
|
||||||
|
*) echo "Snail: unknown Notebook model: $model"; exit -1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
|
|
||||||
sleep 0.01
|
sleep 0.01
|
||||||
let retry--
|
let retry--
|
||||||
|
|
Loading…
Reference in New Issue