#include "exynos_format.h"
#include "gr.h"
-#define ION_HEAP_EXYNOS_CONTIG_MASK (1 << 4)
+#define ION_HEAP_EXYNOS_CONTIG_MASK (1 << 4)
#define ION_EXYNOS_FIMD_VIDEO_MASK (1 << 28)
#define ION_EXYNOS_MFC_OUTPUT_MASK (1 << 26)
#define ION_EXYNOS_MFC_INPUT_MASK (1 << 25)
+#define ION_HEAP_SYSTEM_ID 0
+#define ION_HEAP_EXYNOS_CONTIG_ID 4
+#define ION_HEAP_CHUNK_ID 6
#define MB_1 (1024*1024)
unsigned int heap_mask;
if (usage & GRALLOC_USAGE_PROTECTED)
- heap_mask = ION_HEAP_EXYNOS_CONTIG_MASK;
+ heap_mask = (1 << ION_HEAP_EXYNOS_CONTIG_ID);
else
- heap_mask = ION_HEAP_SYSTEM_MASK;
+ heap_mask = (1 << ION_HEAP_SYSTEM_ID) | (1 << ION_HEAP_CHUNK_ID);
return heap_mask;
}
{
size_t size;
int err, fd;
+ unsigned int heap_mask = _select_heap(usage);
switch (format) {
case HAL_PIXEL_FORMAT_YV12:
return -EINVAL;
}
- err = ion_alloc_fd(ionfd, size, 0, 1 << ION_HEAP_TYPE_SYSTEM,
- ion_flags, &fd);
+ err = ion_alloc_fd(ionfd, size, 0, heap_mask, ion_flags, &fd);
if (err)
return err;
#include <unistd.h> /* size_t */
#define ION_FLAG_CACHED 1
+#define ION_FLAG_CACHED_NEEDS_SYNC 2
#define ION_HEAP_SYSTEM_MASK (1 << 0)
#define ION_HEAP_SYSTEM_CONTIG_MASK (1 << 1)