Skip to content

Commit b67ae78

Browse files
committed
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
1 parent 07f4f97 commit b67ae78

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎drivers/gpu/vga/vga_switcheroo.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,9 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
686686

687687
active->active = false;
688688

689-
set_audio_state(active->id, VGA_SWITCHEROO_OFF);
689+
/* let HDA controller autosuspend if GPU uses driver power control */
690+
if (!active->driver_power_control)
691+
set_audio_state(active->id, VGA_SWITCHEROO_OFF);
690692

691693
if (new_client->fb_info) {
692694
struct fb_event event;
@@ -709,7 +711,9 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
709711
if (vga_switcheroo_pwr_state(active) == VGA_SWITCHEROO_ON)
710712
vga_switchoff(active);
711713

712-
set_audio_state(new_client->id, VGA_SWITCHEROO_ON);
714+
/* let HDA controller autoresume if GPU uses driver power control */
715+
if (!new_client->driver_power_control)
716+
set_audio_state(new_client->id, VGA_SWITCHEROO_ON);
713717

714718
new_client->active = true;
715719
return 0;

0 commit comments

Comments
 (0)