From 5fbf9ed4817f764d81c688a4834419cf1bedf9cc Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 4 Dec 2024 13:37:10 +0200 Subject: [PATCH 1/2] ASoC: SOF: Intel: hda: Add module parameter to disable display audio bind The SOF audio stack expects working Intel eGPU to probe and to have working analog audio. Under special circumstances users or developers can encounter issues of no i915/Xe driver available and thus the SOF audio card is not probing: - Booting kernel on a new architecture where the display driver is not yet working (cannot even force probed) - running in virtualized environment without access to eGPU resources - booting with nomodeset While the percentage of affected users are small, it can still cause unreasonable obstacles on their use cases. With the disable_display_audio_bind=true module parameter the binding can be disabled to let the SOF stack to probe and provide at least working analog audio. Obviously the display audio will not work, but that is expected. Signed-off-by: Peter Ujfalusi --- sound/soc/sof/intel/hda.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c index 0a481575bc54d8..51bdb7401da6d6 100644 --- a/sound/soc/sof/intel/hda.c +++ b/sound/soc/sof/intel/hda.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include "../sof-audio.h" #include "../sof-pci-dev.h" @@ -41,6 +42,11 @@ #include #endif +static bool disable_display_audio_bind; +module_param(disable_display_audio_bind, bool, 0444); +MODULE_PARM_DESC(disable_display_audio_bind, + "Disable i915/Xe display audio component binding"); + /* platform specific devices */ #include "shim.h" @@ -704,6 +710,9 @@ int hda_dsp_probe_early(struct snd_sof_dev *sdev) const struct sof_intel_dsp_desc *chip; int ret = 0; + if (disable_display_audio_bind) + snd_hdac_i915_bind(sof_to_bus(sdev), 0); + if (!sdev->dspless_mode_selected) { /* * detect DSP by checking class/subclass/prog-id information From 22199768b70ca7c98a1f3a609ef8f3ac7e95d072 Mon Sep 17 00:00:00 2001 From: Peter Ujfalusi Date: Wed, 4 Dec 2024 13:38:37 +0200 Subject: [PATCH 2/2] Revert "[NOT FOR UPSTREAM] ASoC: SOF: Intel: lnl: Temporarily disable GPU bind for PTL" This reverts commit 29821cda60a7e9cd22fd7681ea8501555f7124e6. The display audio binding can be disabled with a generic module parameter, there is no longer a need for the patch: options snd-sof-intel-hda-generic disable_display_audio_bind=true Signed-off-by: Peter Ujfalusi --- sound/soc/sof/intel/hda.h | 1 - sound/soc/sof/intel/lnl.c | 19 ------------------- sound/soc/sof/intel/pci-ptl.c | 2 +- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/sound/soc/sof/intel/hda.h b/sound/soc/sof/intel/hda.h index 72bef81fc69348..22bd9c3c8216c5 100644 --- a/sound/soc/sof/intel/hda.h +++ b/sound/soc/sof/intel/hda.h @@ -917,7 +917,6 @@ extern struct snd_sof_dsp_ops sof_mtl_ops; int sof_mtl_ops_init(struct snd_sof_dev *sdev); extern struct snd_sof_dsp_ops sof_lnl_ops; int sof_lnl_ops_init(struct snd_sof_dev *sdev); -int sof_ptl_ops_init(struct snd_sof_dev *sdev); extern const struct sof_intel_dsp_desc skl_chip_info; extern const struct sof_intel_dsp_desc apl_chip_info; diff --git a/sound/soc/sof/intel/lnl.c b/sound/soc/sof/intel/lnl.c index 15ba47633b3cce..e3c4b4a0d705f2 100644 --- a/sound/soc/sof/intel/lnl.c +++ b/sound/soc/sof/intel/lnl.c @@ -7,7 +7,6 @@ */ #include -#include #include #include #include @@ -185,24 +184,6 @@ int sof_lnl_ops_init(struct snd_sof_dev *sdev) }; EXPORT_SYMBOL_NS(sof_lnl_ops_init, SND_SOC_SOF_INTEL_LNL); -static int ptl_hda_dsp_probe_early(struct snd_sof_dev *sdev) -{ - snd_hdac_i915_bind(sof_to_bus(sdev), 0); - return hda_dsp_probe_early(sdev); -} - -int sof_ptl_ops_init(struct snd_sof_dev *sdev) -{ - int ret; - - ret = sof_lnl_ops_init(sdev); - if (!ret) - sof_lnl_ops.probe_early = ptl_hda_dsp_probe_early; - - return ret; -}; -EXPORT_SYMBOL_NS(sof_ptl_ops_init, SND_SOC_SOF_INTEL_LNL); - /* Check if an SDW IRQ occurred */ static bool lnl_dsp_check_sdw_irq(struct snd_sof_dev *sdev) { diff --git a/sound/soc/sof/intel/pci-ptl.c b/sound/soc/sof/intel/pci-ptl.c index ad84d484173298..69195b5e7b1a92 100644 --- a/sound/soc/sof/intel/pci-ptl.c +++ b/sound/soc/sof/intel/pci-ptl.c @@ -44,7 +44,7 @@ static const struct sof_dev_desc ptl_desc = { }, .nocodec_tplg_filename = "sof-ptl-nocodec.tplg", .ops = &sof_lnl_ops, - .ops_init = sof_ptl_ops_init, + .ops_init = sof_lnl_ops_init, }; /* PCI IDs */