thesofproject / linux

Linux kernel source tree
Other
89 stars 129 forks source link

[FEATURE] support vga_switcheroo with SOF #3208

Open kv2019i opened 2 years ago

kv2019i commented 2 years ago

Is your feature request related to a problem? Please describe. On systems with multiplexed GPU and vga-switcheroo enabled in kernel: https://01.org/linuxgraphics/gfx-docs/drm/gpu/vga-switcheroo.html ... the Intel i915 graphics may be switched off at runtime.

Currently SOF does not support this.

Workarounds As a partial work-around, the i915 codec can be disabled in SOF with:

/etc/modprobe.d/intel-audio.conf

# limit SOF driver to only handle the external HDA codec 
options snd_sof_intel_hda_common codec_mask=0x1

.... this does mean no audio via HDMI/DP when GPU mux is set to Intel graphics.

Other workaround is to use snd-hda-intel as the driver (audio DSP disabled):

/etc/modprobe.d/intel-audio.conf

# Force the driver for Intel HDA controller (0=auto, 1=legacy, 2=SST, 3=SOF)
options snd_intel_dspcfg dsp_driver=1

This will limit amount of integrated audio features (PCH DMIC, Soundwire codecs, etc).

References

Discovered when solving https://github.com/thesofproject/sof/issues/4809 This was "HP ZBook Fury 15 G7 Mobile Workstation" running Fedora33.

brianjmurrell commented 2 years ago

Would this require the use/enablement/configuration of vga-switcheroo?

In my case:

# ls -l /sys/kernel/debug/vgaswitcheroo/switch
-rw-r--r--. 1 root root 0 Oct  4 08:05 /sys/kernel/debug/vgaswitcheroo/switch
# cat /sys/kernel/debug/vgaswitcheroo/switch
cat: /sys/kernel/debug/vgaswitcheroo/switch: Operation not permitted

Maybe because I have not done anything to enable/configure vga-switcharoo?

TBH, I really have no desire to go to any effort to use vga-switcharoo and making the result of this ticket be conditional on everyone with muxed GPUs first enabling/configuring/etc vga-switcharoo seems like it would be a marginal solution given the number of people who might be in my situation and don't care about vga-switcharoo.

Just making sure the goal posts for this effort are as useful as possible.