diff options
| -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, | |||
| 266 | const char *pdev_name; | 266 | const char *pdev_name; |
| 267 | int i, ret; | 267 | int i, ret; |
| 268 | bool delay = false, can_switch; | 268 | bool delay = false, can_switch; |
| 269 | bool just_mux = false; | ||
| 269 | int client_id = -1; | 270 | int client_id = -1; |
| 270 | struct vga_switcheroo_client *client = NULL; | 271 | struct vga_switcheroo_client *client = NULL; |
| 271 | 272 | ||
| @@ -320,6 +321,15 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf, | |||
| 320 | if (strncmp(usercmd, "DIS", 3) == 0) | 321 | if (strncmp(usercmd, "DIS", 3) == 0) |
| 321 | client_id = VGA_SWITCHEROO_DIS; | 322 | client_id = VGA_SWITCHEROO_DIS; |
| 322 | 323 | ||
| 324 | if (strncmp(usercmd, "MIGD", 3) == 0) { | ||
| 325 | just_mux = true; | ||
| 326 | client_id = VGA_SWITCHEROO_IGD; | ||
| 327 | } | ||
| 328 | if (strncmp(usercmd, "MDIS", 3) == 0) { | ||
| 329 | just_mux = true; | ||
| 330 | client_id = VGA_SWITCHEROO_DIS; | ||
| 331 | } | ||
| 332 | |||
| 323 | if (client_id == -1) | 333 | if (client_id == -1) |
| 324 | goto out; | 334 | goto out; |
| 325 | 335 | ||
| @@ -331,6 +341,12 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf, | |||
| 331 | } | 341 | } |
| 332 | 342 | ||
| 333 | vgasr_priv.delayed_switch_active = false; | 343 | vgasr_priv.delayed_switch_active = false; |
| 344 | |||
| 345 | if (just_mux) { | ||
| 346 | ret = vgasr_priv.handler->switchto(client_id); | ||
| 347 | goto out; | ||
| 348 | } | ||
| 349 | |||
| 334 | /* okay we want a switch - test if devices are willing to switch */ | 350 | /* okay we want a switch - test if devices are willing to switch */ |
| 335 | can_switch = true; | 351 | can_switch = true; |
| 336 | for (i = 0; i < VGA_SWITCHEROO_MAX_CLIENTS; i++) { | 352 | for (i = 0; i < VGA_SWITCHEROO_MAX_CLIENTS; i++) { |
