Permalink
Browse files

Build-Your-Own-Switcheroo

Combining asus-switcheroo and acpi-call, this driver allows you to
create your own, custom switcheroo acpi driver.  The module has the
following options:

parm:           dummy_client:Enable dummy VGA switcheroo client support (bool)

Just as with asus-switcheroo, this allows for use w/o nouveau (or radeon)

parm:           igd_vendor:int

This distinguishes the PCI vendor ID of the integrated graphics.  The
default is 0x8086 (Intel).

parm:           switchto_igd:charp

acpi_call style script to switch to IGD

parm:           switchto_dis:charp

acpi_call style script to switch to DIS

parm:           power_state_igd_on:charp

acpi_call style script to power IGD on (typically not used)

parm:           power_state_igd_off:charp

acpi_call style script to power IGD off (typically not used)

parm:           power_state_dis_on:charp

acpi_call style script to power DIS on

parm:           power_state_dis_off:charp

acpi_call style script to power DIS off

There's also support for special callbacks using a "!" identifier.
Currently, nouveau_fbcon_output_poll_changed is the only one defined.

To get behavior identical to asus-switcher, I use these:

MXMX 0x1
MXDS 0x1
_DSM
{0xA0,0xA0,0x95,0x9D,0x60,0x00,0x48,0x4D,0xB3,0x4D,0x7E,0x5F,0xEA,0x12,0x9F,0xD4} 0x102 0x2 {0x12,0x0,0x0,0x0}
!nouveau_fbcon_output_poll_changed

MXMX 0x1
MXDS 0x1
_DSM
{0xA0,0xA0,0x95,0x9D,0x60,0x00,0x48,0x4D,0xB3,0x4D,0x7E,0x5F,0xEA,0x12,0x9F,0xD4} 0x102 0x2 {0x11,0x0,0x0,0x0}

_DSM
{0xA0,0xA0,0x95,0x9D,0x60,0x00,0x48,0x4D,0xB3,0x4D,0x7E,0x5F,0xEA,0x12,0x9F,0xD4} 0x102 0x3 {0x1,0x0,0x0,0x0}

_DSM
{0xA0,0xA0,0x95,0x9D,0x60,0x00,0x48,0x4D,0xB3,0x4D,0x7E,0x5F,0xEA,0x12,0x9F,0xD4} 0x102 0x3 {0x2,0x0,0x0,0x0}

Note that the acpi_call scripts are changeable at runtime by writing to
the /sys/module/byo-switcheroo/parameters files.  The only options
necessary at module load time are dummy_client (only if you wish to
enable ot), and igd_vendor (only if you want to specify something other
than Intel).

Also note, this module does nothing more than register an empty handler
unless you provide acpi_call scripts to run on switching.  If it doesn't
work for you, find the right acpi_call script to make it work, and post
the recipe for everyone else.

acpi_call scripts can have commands separated by new lines or ';'.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
  • Loading branch information...
1 parent 178d072 commit 0e97c873aeb5680c9d6d5dc384e45100869e6823 @awilliam committed May 14, 2011
Showing with 405 additions and 1 deletion.
  1. +4 −1 Makefile
  2. +401 −0 byo-switcheroo.c
View
@@ -1,4 +1,4 @@
-obj-m := asus-switcheroo.o i915-jprobe.o nouveau-jprobe.o
+obj-m := asus-switcheroo.o i915-jprobe.o nouveau-jprobe.o byo-switcheroo.o
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)
@@ -11,6 +11,7 @@ clean:
install-fedora:
install -m 0644 -D asus-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/asus-switcheroo.ko
+ install -m 0644 -D byo-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/byo-switcheroo.ko
install -m 0644 -D i915-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/i915-jprobe.ko
install -m 0644 -D nouveau-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/nouveau-jprobe.ko
depmod -a
@@ -30,6 +31,7 @@ uninstall-fedora:
install-ubuntu:
install -m 0644 -D asus-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/asus-switcheroo.ko
+ install -m 0644 -D byo-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/byo-switcheroo.ko
install -m 0644 -D i915-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/i915-jprobe.ko
install -m 0644 -D nouveau-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/nouveau-jprobe.ko
depmod -a
@@ -56,6 +58,7 @@ uninstall-ubuntu:
install-arch:
install -m 0644 -D asus-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/asus-switcheroo.ko
+ install -m 0644 -D byo-switcheroo.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/byo-switcheroo.ko
install -m 0644 -D i915-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/i915-jprobe.ko
install -m 0644 -D nouveau-jprobe.ko /lib/modules/$(shell uname -r)/extra/asus-switcheroo/nouveau-jprobe.ko
depmod -a
Oops, something went wrong.

0 comments on commit 0e97c87

Please sign in to comment.