diff options
author | Dave Airlie <airlied@redhat.com> | 2010-12-06 12:35:52 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-01-05 13:43:15 +1000 |
commit | 851ab954daee0d8328e239a468835e36e6215182 (patch) | |
tree | eb179d7340780843e7a9853232691e05228d5947 /drivers/gpu/vga | |
parent | 5cfb3c3a1013e7fca54c3624871755cdfd960b3b (diff) | |
download | linux-851ab954daee0d8328e239a468835e36e6215182.tar.gz linux-851ab954daee0d8328e239a468835e36e6215182.tar.bz2 linux-851ab954daee0d8328e239a468835e36e6215182.zip |
vga_switcheroo: add debugging mux switch option.
This allows the mux to be switched from userspace using MIGD/MDIS
command to the switch.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/vga')
-rw-r--r-- | drivers/gpu/vga/vga_switcheroo.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c index c3c213b74478..463691a1650e 100644 --- a/drivers/gpu/vga/vga_switcheroo.c +++ b/drivers/gpu/vga/vga_switcheroo.c @@ -266,6 +266,7 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf, const char *pdev_name; int i, ret; bool delay = false, can_switch; + bool just_mux = false; int client_id = -1; struct vga_switcheroo_client *client = NULL; @@ -320,6 +321,15 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf, if (strncmp(usercmd, "DIS", 3) == 0) client_id = VGA_SWITCHEROO_DIS; + if (strncmp(usercmd, "MIGD", 3) == 0) { + just_mux = true; + client_id = VGA_SWITCHEROO_IGD; + } + if (strncmp(usercmd, "MDIS", 3) == 0) { + just_mux = true; + client_id = VGA_SWITCHEROO_DIS; + } + if (client_id == -1) goto out; @@ -331,6 +341,12 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf, } vgasr_priv.delayed_switch_active = false; + + if (just_mux) { + ret = vgasr_priv.handler->switchto(client_id); + goto out; + } + /* okay we want a switch - test if devices are willing to switch */ can_switch = true; for (i = 0; i < VGA_SWITCHEROO_MAX_CLIENTS; i++) { |