Loading media/codec2/vndk/C2DmaBufAllocator.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -315,8 +315,8 @@ c2_status_t C2DmaBufAllocator::mapUsage(C2MemoryUsage usage, size_t capacity, C2 if (mUsageMapper) { res = mUsageMapper(usage, capacity, heap_name, flags); } else { // No system-uncached yet, so disabled for now if (0 && !(usage.expected & (C2MemoryUsage::CPU_READ | C2MemoryUsage::CPU_WRITE))) if (C2DmaBufAllocator::system_uncached_supported() && !(usage.expected & (C2MemoryUsage::CPU_READ | C2MemoryUsage::CPU_WRITE))) *heap_name = "system-uncached"; else *heap_name = "system"; Loading media/codec2/vndk/C2Store.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -822,7 +822,13 @@ private: }; static C2R setDmaBufUsage(bool /* mayBlock */, C2P<C2StoreDmaBufUsageInfo> &me) { long long usage = (long long)me.get().m.usage; if (C2DmaBufAllocator::system_uncached_supported() && !(usage & (C2MemoryUsage::CPU_READ | C2MemoryUsage::CPU_WRITE))) { strncpy(me.set().m.heapName, "system-uncached", me.v.flexCount()); } else { strncpy(me.set().m.heapName, "system", me.v.flexCount()); } me.set().m.allocFlags = 0; return C2R::Ok(); }; Loading media/codec2/vndk/include/C2DmaBufAllocator.h +10 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,16 @@ class C2DmaBufAllocator : public C2Allocator { void setUsageMapper(const UsageMapperFn& mapper, uint64_t minUsage, uint64_t maxUsage, uint64_t blockSize); static bool system_uncached_supported(void) { static int cached_result = -1; if (cached_result == -1) { struct stat buffer; cached_result = (stat("/dev/dma_heap/system-uncached", &buffer) == 0); } return (cached_result == 1); }; private: c2_status_t mInit; BufferAllocator mBufferAllocator; Loading Loading
media/codec2/vndk/C2DmaBufAllocator.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -315,8 +315,8 @@ c2_status_t C2DmaBufAllocator::mapUsage(C2MemoryUsage usage, size_t capacity, C2 if (mUsageMapper) { res = mUsageMapper(usage, capacity, heap_name, flags); } else { // No system-uncached yet, so disabled for now if (0 && !(usage.expected & (C2MemoryUsage::CPU_READ | C2MemoryUsage::CPU_WRITE))) if (C2DmaBufAllocator::system_uncached_supported() && !(usage.expected & (C2MemoryUsage::CPU_READ | C2MemoryUsage::CPU_WRITE))) *heap_name = "system-uncached"; else *heap_name = "system"; Loading
media/codec2/vndk/C2Store.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -822,7 +822,13 @@ private: }; static C2R setDmaBufUsage(bool /* mayBlock */, C2P<C2StoreDmaBufUsageInfo> &me) { long long usage = (long long)me.get().m.usage; if (C2DmaBufAllocator::system_uncached_supported() && !(usage & (C2MemoryUsage::CPU_READ | C2MemoryUsage::CPU_WRITE))) { strncpy(me.set().m.heapName, "system-uncached", me.v.flexCount()); } else { strncpy(me.set().m.heapName, "system", me.v.flexCount()); } me.set().m.allocFlags = 0; return C2R::Ok(); }; Loading
media/codec2/vndk/include/C2DmaBufAllocator.h +10 −0 Original line number Diff line number Diff line Loading @@ -84,6 +84,16 @@ class C2DmaBufAllocator : public C2Allocator { void setUsageMapper(const UsageMapperFn& mapper, uint64_t minUsage, uint64_t maxUsage, uint64_t blockSize); static bool system_uncached_supported(void) { static int cached_result = -1; if (cached_result == -1) { struct stat buffer; cached_result = (stat("/dev/dma_heap/system-uncached", &buffer) == 0); } return (cached_result == 1); }; private: c2_status_t mInit; BufferAllocator mBufferAllocator; Loading