summaryrefslogtreecommitdiffstats
path: root/exynos4
diff options
context:
space:
mode:
authorShilin Victor <radicaldreamer00001@gmail.com>2019-04-10 16:55:16 +0300
committerShilin Victor <radicaldreamer00001@gmail.com>2019-04-10 17:48:33 +0300
commitd8678c1bc27df4b029319fac55005d8ea133c51d (patch)
tree0039d8dea27b0643ff23bff36dddc57c03d67c72 /exynos4
parent118693e7d9525efd15f459a3d15e53bf6ee52434 (diff)
downloadhardware_samsung-d8678c1bc27df4b029319fac55005d8ea133c51d.tar.gz
hardware_samsung-d8678c1bc27df4b029319fac55005d8ea133c51d.tar.bz2
hardware_samsung-d8678c1bc27df4b029319fac55005d8ea133c51d.zip
exynos4: gralloc: try to limit ION allocations
limit the allowed set of usage flags in order to prevent ION memory exhausting. Change-Id: I87ea925c33ecfe7f2728b84cc5a316530d7d8765
Diffstat (limited to 'exynos4')
-rw-r--r--exynos4/hal/libgralloc_ump/alloc_device.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/exynos4/hal/libgralloc_ump/alloc_device.cpp b/exynos4/hal/libgralloc_ump/alloc_device.cpp
index cd53376..f0b5b12 100644
--- a/exynos4/hal/libgralloc_ump/alloc_device.cpp
+++ b/exynos4/hal/libgralloc_ump/alloc_device.cpp
@@ -296,8 +296,9 @@ static int gralloc_alloc_buffer(alloc_device_t* dev, size_t size, int usage,
}
ret = -1;
- if (usage & (GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE)) {
- ALOGV("%s: Allocating graphicbuffer via ION...", __func__);
+ if (usage & (GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE |
+ GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_OFTEN)) {
+ ALOGD_IF(debug_level > 0, "%s: Allocating graphicbuffer via ION...", __func__);
priv_alloc_flag = priv_alloc_flag | private_handle_t::PRIV_FLAGS_GRAPHICBUFFER;
ret = gralloc_alloc_ion(dev, size, usage, format, &ion_fd, &ion_paddr, &priv_alloc_flag, &ump_mem_handle);
}