ALSA: memalloc: Add non-cached buffer type
authorTakashi Iwai <tiwai@suse.de>
Wed, 8 Aug 2018 15:01:00 +0000 (17:01 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 28 Aug 2018 11:56:47 +0000 (13:56 +0200)
commit42e748a0b3251cca0de2c269ca106884907eb289
treec9ef6999ece2e29f2c6ba4cf73666377c5b943aa
parent28f3f4f685d7d7226ba4ed4f78e04c75dd3a5b27
ALSA: memalloc: Add non-cached buffer type

In some cases (mainly for x86), we need the DMA coherent buffer with
non-cached pages.  Although this has been done in each driver side
like HD-audio and intel8x0, it can be done cleaner in the core memory
allocator.

This patch adds the new types, SNDRV_DMA_TYPE_DEV_UC and
SNDRV_DMA_TYPE_DEV_UC_SG, for allocating such non-cached buffer
pages.  On non-x86 architectures, they work as same as the standard
SNDRV_DMA_TYPE_DEV and *_SG.

One additional change by this move is that we can assure to pass the
non-cached pgprot to the vmapped buffer, too.  It eventually fixes the
case like non-snoop mode without mmap access on HD-audio.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound/memalloc.h
sound/core/memalloc.c
sound/core/sgbuf.c