From 049cef0c8c72e7023739100c180043bd993d8e3f Mon Sep 17 00:00:00 2001 From: Naseer Ahmed Date: Mon, 14 Nov 2011 14:44:34 -0800 Subject: [PATCH] C2D HAL: Enable ION Change-Id: Ibfd124d620bab018bc89dd37e4471270c93aa58d --- libcopybit/copybit_c2d.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libcopybit/copybit_c2d.cpp b/libcopybit/copybit_c2d.cpp index 88f59de..0995345 100644 --- a/libcopybit/copybit_c2d.cpp +++ b/libcopybit/copybit_c2d.cpp @@ -208,10 +208,17 @@ static uint32 c2d_get_gpuaddr(int device_fd, struct private_handle_t *handle) param.offset = handle->offset; param.hostptr = handle->base; - if (handle->flags & (private_handle_t::PRIV_FLAGS_USES_PMEM|private_handle_t::PRIV_FLAGS_USES_PMEM_ADSP)) + if (handle->flags & (private_handle_t::PRIV_FLAGS_USES_PMEM | + private_handle_t::PRIV_FLAGS_USES_PMEM_ADSP)) param.memtype = KGSL_USER_MEM_TYPE_PMEM; - else + else if (handle->flags & private_handle_t::PRIV_FLAGS_USES_ASHMEM) param.memtype = KGSL_USER_MEM_TYPE_ASHMEM; + else if (handle->flags & private_handle_t::PRIV_FLAGS_USES_ION) + param.memtype = KGSL_USER_MEM_TYPE_ION; + else { + LOGE("Invalid handle flags: 0x%x", handle->flags); + return 0; + } if (!ioctl(device_fd, IOCTL_KGSL_MAP_USER_MEM, (void *)¶m, sizeof(param))) { return param.gpuaddr;