ALSA: memalloc: Unify x86 SG-buffer handling (take#2)
PATCH 1/1 ALSA: memalloc: Unify x86 SG-buffer handling (take#2)
This is a second attempt to unify the x86-specific SG-buffer handling code with the new standard non-contiguous page handler.
The first try (in commit 2d9ea39917a4) failed due to the wrong page and address calculations, hence reverted. Now it's corrected with the previous fix for noncontig pages, and the proper sg page iteration by this patch.
After the migration, SNDRV_DMA_TYPE_DMA_SG becomes identical with SNDRV_DMA_TYPE_NONCONTIG on x86, while others still fall back to SNDRV_DMA_TYPE_DEV.
Tested-by Alex Xu (Hello71) <[email protected]>
Signed-off-by Takashi Iwai <[email protected]>
--- include/sound/memalloc.h | 14 +-- sound/core/Makefile | 1 - sound/core/memalloc.c | 43 ++++++++- sound/core/sgbuf.c | 201 --------------------------------------- 4 files changed, 46 insertions(+), 213 deletions(-) delete mode 100644 sound/core/sgbuf.c
include/sound/memalloc.h +7 -7
@@ -36,13 +36,6 @@ struct snd_dma_device {#define SNDRV_DMA_TYPE_CONTINUOUS 1/* continuous no-DMA memory */ #define SNDRV_DMA_TYPE_DEV 2/* generic device continuous */ #define SNDRV_DMA_TYPE_DEV_WC 5/* continuous write-combined */ -#ifdef CONFIG_SND_DMA_SGBUF -#define SNDRV_DMA_TYPE_DEV_SG 3/* generic device SG-buffer */ -#define SNDRV_DMA_TYPE_DEV_WC_SG 6/* SG write-combined */ -#else -#define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_DEV/* no SG-buf support */ -#define SNDRV_DMA_TYPE_DEV_WC_SG SNDRV_DMA_TYPE_DEV_WC -#endif #ifdef CONFIG_GENERIC_ALLOCATOR #define SNDRV_DMA_TYPE_DEV_IRAM 4/* generic device iram-buffer */ #else
@@ -51,6 +44,13 @@ struct snd_dma_device {#define SNDRV_DMA_TYPE_VMALLOC 7/* vmalloc'ed buffer */ #define SNDRV_DMA_TYPE_NONCONTIG 8/* non-coherent SG buffer */ #define SNDRV_DMA_TYPE_NONCOHERENT 9/* non-coherent buffer */ +#ifdef CONFIG_SND_DMA_SGBUF +#define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_NONCONTIG +#define SNDRV_DMA_TYPE_DEV_WC_SG 6/* SG write-combined */ +#else +#define SNDRV_DMA_TYPE_DEV_SG SNDRV_DMA_TYPE_DEV/* no SG-buf support */ +#define SNDRV_DMA_TYPE_DEV_WC_SG SNDRV_DMA_TYPE_DEV_WC +#endif /* * info for buffer allocation
sound/core/Makefile +0 -1
@@ -19,7 +19,6 @@ snd-$(CONFIG_SND_JACK) += ctljack.o jack.o snd-pcm-y := pcm.o pcm_native.o pcm_lib.o pcm_misc.o \ pcm_memory.o memalloc.o snd-pcm-$(CONFIG_SND_PCM_TIMER) += pcm_timer.o -snd-pcm-$(CONFIG_SND_DMA_SGBUF) += sgbuf.o snd-pcm-$(CONFIG_SND_PCM_ELD) += pcm_drm_eld.o snd-pcm-$(CONFIG_SND_PCM_IEC958) += pcm_iec958.o
sound/core/memalloc.c +39 -4
59 lines not on this page · raw message
sound/core/sgbuf.c deleted +0 -201
201 lines not on this page · raw message
Signature · 1 line
2.26.2