Commit 5cfb3c3a authored by Dave Airlie's avatar Dave Airlie

vga_switcheroo: make power switch handler optional

At least on the nvidia mux the power switch seems to be executed
by the ACPI PS0/PS3 methods so need to do it explicitly.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 6c2df40e
...@@ -191,9 +191,8 @@ static int vga_switcheroo_debugfs_open(struct inode *inode, struct file *file) ...@@ -191,9 +191,8 @@ static int vga_switcheroo_debugfs_open(struct inode *inode, struct file *file)
static int vga_switchon(struct vga_switcheroo_client *client) static int vga_switchon(struct vga_switcheroo_client *client)
{ {
int ret; if (vgasr_priv.handler->power_state)
vgasr_priv.handler->power_state(client->id, VGA_SWITCHEROO_ON);
ret = vgasr_priv.handler->power_state(client->id, VGA_SWITCHEROO_ON);
/* call the driver callback to turn on device */ /* call the driver callback to turn on device */
client->set_gpu_state(client->pdev, VGA_SWITCHEROO_ON); client->set_gpu_state(client->pdev, VGA_SWITCHEROO_ON);
client->pwr_state = VGA_SWITCHEROO_ON; client->pwr_state = VGA_SWITCHEROO_ON;
...@@ -204,6 +203,7 @@ static int vga_switchoff(struct vga_switcheroo_client *client) ...@@ -204,6 +203,7 @@ static int vga_switchoff(struct vga_switcheroo_client *client)
{ {
/* call the driver callback to turn off device */ /* call the driver callback to turn off device */
client->set_gpu_state(client->pdev, VGA_SWITCHEROO_OFF); client->set_gpu_state(client->pdev, VGA_SWITCHEROO_OFF);
if (vgasr_priv.handler->power_state)
vgasr_priv.handler->power_state(client->id, VGA_SWITCHEROO_OFF); vgasr_priv.handler->power_state(client->id, VGA_SWITCHEROO_OFF);
client->pwr_state = VGA_SWITCHEROO_OFF; client->pwr_state = VGA_SWITCHEROO_OFF;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment