mirror of https://github.com/thesofproject/sof.git
Kconfig: use uncached buffer only for debugging
To rule out buffer coherency issue, it is useful to add a debug option with which selected only coherent/uncached buffer will be used. Signed-off-by: Keyon Jie <yang.jie@linux.intel.com>
This commit is contained in:
parent
4681db38da
commit
7378b2489a
|
@ -12,3 +12,12 @@ config DEBUG_BLOCK_FREE
|
|||
already freed block of memory. Enabling this feature increases
|
||||
number of memory writes and reads, due to checks for memory patterns
|
||||
that may be performed on allocation and deallocation.
|
||||
|
||||
config DEBUG_FORCE_COHERENT_BUFFER
|
||||
bool "Force the allocator to allocate coherent buffer only"
|
||||
default n
|
||||
help
|
||||
Select if we want to force the allocator to return coherent/uncached
|
||||
buffer only.
|
||||
This should be selected for debug purpose only, as accessing buffer
|
||||
without caching it will reduce the read/write performance.
|
||||
|
|
|
@ -921,8 +921,12 @@ static void *_balloc_unlocked(uint32_t flags, uint32_t caps, size_t bytes,
|
|||
if (!ptr)
|
||||
return ptr;
|
||||
|
||||
#ifdef CONFIG_DEBUG_FORCE_COHERENT_BUFFER
|
||||
return cache_to_uncache(ptr);
|
||||
#else
|
||||
return (flags & SOF_MEM_FLAG_COHERENT) && (CONFIG_CORE_COUNT > 1) ?
|
||||
cache_to_uncache(ptr) : uncache_to_cache(ptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* allocates continuous buffers - not for direct use, clients use rballoc() */
|
||||
|
|
Loading…
Reference in New Issue