mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-27 09:15:11 +07:00
c31427d0d2
Like many other drivers, HD-audio drivers also do PCM buffer preallocation to assure the buffer pages allocated at the early boot stage. This step is useful for platforms that may fail to allocate the PCM hardware buffers -- which is mostly for either large continuous pages or with the specific DMA mask (like emu10k1). OTOH, when a buffer is allocated as SG-buffer and the DMA mask is either 32 or 64 bits, the allocation almost never fails unless it hits the real OOM situation. In such a case, we don't need the preallocation inevitably unlike the cases above. That said, we may drop the preallocation for HD-audio that does allocate via SG-buffers, and the patch achieves it. However, there is one caveat: the buffer allocation behavior depends on CONFIG_SND_DMA_SGBUF, and it falls back to the continuous pages when it's not set. And, currently this SG buffer allocation is enabled only on x86 platforms. So, covering those fall-outs, the patch adjusts CONFIG_SND_HDA_PREALLOC_SIZE depending on the condition, and keeps the old behavior as-is for non-x86 platforms. On x86, the kconfig item is no longer adjustable but always set to zero for disabling the preallocation. You can still enable the preallocation via procfs interface at any time later, too. Link: https://lore.kernel.org/r/20200120124423.11862-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
48 lines
1.2 KiB
Plaintext
48 lines
1.2 KiB
Plaintext
# SPDX-License-Identifier: GPL-2.0-only
|
|
config SND_HDA_CORE
|
|
tristate
|
|
select REGMAP
|
|
|
|
config SND_HDA_DSP_LOADER
|
|
bool
|
|
|
|
config SND_HDA_ALIGNED_MMIO
|
|
bool
|
|
|
|
config SND_HDA_COMPONENT
|
|
bool
|
|
|
|
config SND_HDA_I915
|
|
bool
|
|
select SND_HDA_COMPONENT
|
|
|
|
config SND_HDA_EXT_CORE
|
|
tristate
|
|
select SND_HDA_CORE
|
|
|
|
config SND_HDA_PREALLOC_SIZE
|
|
int "Pre-allocated buffer size for HD-audio driver" if !SND_DMA_SGBUF
|
|
range 0 32768
|
|
default 0 if SND_DMA_SGBUF
|
|
default 64 if !SND_DMA_SGBUF
|
|
help
|
|
Specifies the default pre-allocated buffer-size in kB for the
|
|
HD-audio driver. A larger buffer (e.g. 2048) is preferred
|
|
for systems using PulseAudio. The default 64 is chosen just
|
|
for compatibility reasons.
|
|
On x86 systems, the default is zero as we need no preallocation.
|
|
|
|
Note that the pre-allocation size can be changed dynamically
|
|
via a proc file (/proc/asound/card*/pcm*/sub*/prealloc), too.
|
|
|
|
config SND_INTEL_NHLT
|
|
bool
|
|
# this config should be selected only for Intel ACPI platforms.
|
|
# A fallback is provided so that the code compiles in all cases.
|
|
|
|
config SND_INTEL_DSP_CONFIG
|
|
tristate
|
|
select SND_INTEL_NHLT if ACPI
|
|
# this config should be selected only for Intel DSP platforms.
|
|
# A fallback is provided so that the code compiles in all cases.
|