vga_switcheroo: Let HDA autosuspend on mux change

When switching the display on muxed machines, we currently force the HDA
controller into runtime suspend on the previously used GPU and into
runtime active state on the newly used GPU.

That's unnecessary if the GPU uses driver power control, we can just let
the audio device autosuspend or autoresume as it sees fit.

Cc: Dave Airlie <airlied@redhat.com>
Cc: Ben Skeggs <bskeggs@redhat.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Link: https://patchwork.freedesktop.org/patch/msgid/098ed883460eb4976a899eac6f5192fefc877c0f.1520068884.git.lukas@wunner.de
This commit is contained in:
Lukas Wunner 2018-03-03 10:53:24 +01:00
parent 07f4f97d7b
commit b67ae78efa
1 changed files with 6 additions and 2 deletions

View File

@ -686,6 +686,8 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
active->active = false; active->active = false;
/* let HDA controller autosuspend if GPU uses driver power control */
if (!active->driver_power_control)
set_audio_state(active->id, VGA_SWITCHEROO_OFF); set_audio_state(active->id, VGA_SWITCHEROO_OFF);
if (new_client->fb_info) { if (new_client->fb_info) {
@ -709,6 +711,8 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
if (vga_switcheroo_pwr_state(active) == VGA_SWITCHEROO_ON) if (vga_switcheroo_pwr_state(active) == VGA_SWITCHEROO_ON)
vga_switchoff(active); vga_switchoff(active);
/* let HDA controller autoresume if GPU uses driver power control */
if (!new_client->driver_power_control)
set_audio_state(new_client->id, VGA_SWITCHEROO_ON); set_audio_state(new_client->id, VGA_SWITCHEROO_ON);
new_client->active = true; new_client->active = true;