summaryrefslogtreecommitdiff
authorbinqi.zhang <binqi.zhang@amlogic.com>2017-07-13 07:02:14 (GMT)
committer Binqi Zhang <binqi.zhang@amlogic.com>2017-08-01 11:44:39 (GMT)
commit41820239ae389e2d7e605753a42ff7e544ccae35 (patch)
tree4f84998872b930f64a295c1f727ac05cffc97abf
parentd3683b5586ad280c7e24b72d7d6fa50381d4cc59 (diff)
downloadgralloc-41820239ae389e2d7e605753a42ff7e544ccae35.zip
gralloc-41820239ae389e2d7e605753a42ff7e544ccae35.tar.gz
gralloc-41820239ae389e2d7e605753a42ff7e544ccae35.tar.bz2
osd: enable ion CMA heap on kernel 3.14 [2/2]
PD# 147087 enable ion CMA heap on kernel 3.14 Change-Id: I9cf7cb9515143f12f3678ecba3c557f60d6e0ad2 (cherry picked from commit af152cd8b49674801599b8ecbe1cba51b61626bd)
Diffstat
-rw-r--r--alloc_ion.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/alloc_ion.cpp b/alloc_ion.cpp
index a449bb0..1545eda 100644
--- a/alloc_ion.cpp
+++ b/alloc_ion.cpp
@@ -117,8 +117,13 @@ int alloc_backend_alloc(alloc_device_t* dev, size_t size, int usage, buffer_hand
ret = ion_alloc(m->ion_client, size, 0,
1<<ION_HEAP_TYPE_CHUNK, ion_flags, &ion_hnd);
if (ret != 0) {
+ ALOGV("(%d) Failed to alloc ion chunk mem, alloc from ion cma buffer.", ret);
+ ret = ion_alloc(m->ion_client, size, 0,
+ 1<<ION_HEAP_TYPE_DMA, ion_flags, &ion_hnd);
+ }
+ if (ret != 0) {
layerAllocContinousBuf = false;
- ALOGD("(%d) Failed to alloc ion chunk mem, alloc from system ion buffer.", ret);
+ ALOGD("(%d) Failed to alloc ion cma mem, alloc from system ion buffer.", ret);
ret = ion_alloc(m->ion_client, size, 0, heap_mask,
ion_flags, &ion_hnd);
}