Allocate cached ION buffers.
We're doing lots of CPU access of ION buffers and with no caching this
access is pretty slow. By allocating with ION_FLAG_CACHED CPU mapped
pages will be cached and for example a memcpy of a decoded 1080p video
frame is about 3x faster. When writing to a buffer from CPU ("software
rendering") ION will ensure proper cache management on munmap.
For cases not involving CPU access (e.g. VPU directly to GPU) this is
In the Android world this corresponds to gralloc-ing with
GRALLOC_USAGE_SW_READ | GRALLOC_USAGE_SW_WRITE.
1 file changed