exynos hal: jellybean compat
diff --git a/exynos5/hal/libgralloc_ump/Android.mk b/exynos5/hal/libgralloc_ump/Android.mk
index a4354d4..84cac10 100644
--- a/exynos5/hal/libgralloc_ump/Android.mk
+++ b/exynos5/hal/libgralloc_ump/Android.mk
@@ -40,14 +40,14 @@
ifeq ($(TARGET_PRODUCT), armboard_v7a)
# Support for ARM platforms
-LOCAL_CFLAGS:= -DLOG_TAG=\"gralloc\" -DGRALLOC_16_BITS -DSTANDARD_LINUX_SCREEN \
+LOCAL_CFLAGS:= -DALOG_TAG=\"gralloc\" -DGRALLOC_16_BITS -DSTANDARD_LINUX_SCREEN \
-march=armv7-a \
-mfloat-abi=softfp
LOCAL_MODULE := gralloc.default
else
#Default to goldfish
-LOCAL_CFLAGS:= -DLOG_TAG=\"gralloc\" -DSTANDARD_LINUX_SCREEN \
+LOCAL_CFLAGS:= -DALOG_TAG=\"gralloc\" -DSTANDARD_LINUX_SCREEN \
-march=armv7-a \
-mfloat-abi=softfp \
-DVITHAR_HACK
diff --git a/exynos5/hal/libgralloc_ump/alloc_device.cpp b/exynos5/hal/libgralloc_ump/alloc_device.cpp
index 64be027..52c8724 100644
--- a/exynos5/hal/libgralloc_ump/alloc_device.cpp
+++ b/exynos5/hal/libgralloc_ump/alloc_device.cpp
@@ -68,13 +68,13 @@
private_module_t* m = reinterpret_cast<private_module_t*>(dev->common.module);
ion_fd = ion_alloc(m->ion_client, size, 0, ION_HEAP_EXYNOS_MASK);
if (ion_fd < 0) {
- LOGE("Failed to ion_alloc");
+ ALOGE("Failed to ion_alloc");
return -1;
}
cpu_ptr = ion_map(ion_fd, size, 0);
if (NULL == cpu_ptr) {
- LOGE("Failed to ion_map");
+ ALOGE("Failed to ion_map");
ion_free(ion_fd);
return -1;
}
@@ -83,7 +83,7 @@
if (UMP_INVALID_MEMORY_HANDLE != ump_mem_handle) {
priv_alloc_flag = private_handle_t::PRIV_FLAGS_USES_ION;
} else {
- LOGE("gralloc_alloc_buffer() failed to import ION memory");
+ ALOGE("gralloc_alloc_buffer() failed to import ION memory");
ion_unmap(cpu_ptr, size);
ion_free(ion_fd);
return -1;
@@ -120,7 +120,7 @@
if (UMP_INVALID_MEMORY_HANDLE != ump_mem_handle)
cpu_ptr = ump_map(ump_mem_handle, 0, size);
else
- LOGE("gralloc_alloc_buffer() failed to allcoate UMP memory");
+ ALOGE("gralloc_alloc_buffer() failed to allcoate UMP memory");
}
if (NULL != cpu_ptr) {
@@ -144,15 +144,15 @@
hnd->voffset = ((EXYNOS_ALIGN((hnd->width >> 1), 8) * EXYNOS_ALIGN((hnd->height >> 1), 8)));
return 0;
} else {
- LOGE("gralloc_alloc_buffer() failed to allocate handle");
+ ALOGE("gralloc_alloc_buffer() failed to allocate handle");
}
} else {
- LOGE("gralloc_alloc_buffer() failed to retrieve valid secure id");
+ ALOGE("gralloc_alloc_buffer() failed to retrieve valid secure id");
}
ump_unmap(ump_mem_handle, cpu_ptr, size);
} else {
- LOGE("gralloc_alloc_buffer() failed to map UMP memory");
+ ALOGE("gralloc_alloc_buffer() failed to map UMP memory");
}
ump_release(ump_mem_handle);
@@ -187,13 +187,13 @@
*/
int newUsage = (usage & ~GRALLOC_USAGE_HW_FB) | GRALLOC_USAGE_HW_2D;
- LOGD("fallback to single buffering");
+ ALOGD("fallback to single buffering");
return gralloc_alloc_buffer(dev, bufferSize, newUsage, pHandle, w, h, format, bpp, 0, 0);
}
if (bufferMask >= ((1LU<<numBuffers)-1)) {
- LOGE("Ran out of buffers");
+ ALOGE("Ran out of buffers");
return -ENOMEM;
}
@@ -236,7 +236,7 @@
int usage, buffer_handle_t* pHandle, int* pStride)
{
if (!pHandle || !pStride) {
- LOGE("Invalid Handle, Stride value");
+ ALOGE("Invalid Handle, Stride value");
return -EINVAL;
}
@@ -269,7 +269,7 @@
bpp = 4;
break;
default:
- LOGE("Not Support Pixel Format");
+ ALOGE("Not Support Pixel Format");
return -EINVAL;
}
@@ -289,7 +289,7 @@
format, 0, (int)stride_raw, (int)stride);
if (err < 0) {
- LOGE("Fail to alloc Gralloc memory");
+ ALOGE("Fail to alloc Gralloc memory");
return err;
}
@@ -300,7 +300,7 @@
static int alloc_device_free(alloc_device_t* dev, buffer_handle_t handle)
{
if (private_handle_t::validate(handle) < 0) {
- LOGE("Invalid Value : private_handle");
+ ALOGE("Invalid Value : private_handle");
return -EINVAL;
}
@@ -346,19 +346,19 @@
dev = new alloc_device_t;
if (NULL == dev) {
- LOGE("Fail to create alloc_device");
+ ALOGE("Fail to create alloc_device");
return -1;
}
dev->common.module = const_cast<hw_module_t*>(module);
private_module_t* m = reinterpret_cast<private_module_t*>(dev->common.module);
m->ion_client=ion_client_create();
- LOGI("gralloc create ion_client %d", m->ion_client);
+ ALOGI("gralloc create ion_client %d", m->ion_client);
ump_result ump_res = ump_open();
if ((UMP_OK != ump_res) || (0 > m->ion_client)) {
- LOGE("UMP open failed, ump_res %d, ion_client %d", ump_res, m->ion_client);
+ ALOGE("UMP open failed, ump_res %d, ion_client %d", ump_res, m->ion_client);
delete dev;
return -1;
}
diff --git a/exynos5/hal/libgralloc_ump/framebuffer_device.cpp b/exynos5/hal/libgralloc_ump/framebuffer_device.cpp
index 0015e54..1e64d72 100644
--- a/exynos5/hal/libgralloc_ump/framebuffer_device.cpp
+++ b/exynos5/hal/libgralloc_ump/framebuffer_device.cpp
@@ -73,7 +73,7 @@
#ifdef STANDARD_LINUX_SCREEN
if (ioctl(m->framebuffer->fd, FBIOPAN_DISPLAY, &m->info) == -1) {
- LOGE("FBIOPAN_DISPLAY failed");
+ ALOGE("FBIOPAN_DISPLAY failed");
m->base.unlock(&m->base, buffer);
return 0;
}
@@ -81,13 +81,13 @@
/* wait for VSYNC */
int crtc = 0;
if (ioctl(m->framebuffer->fd, FBIO_WAITFORVSYNC, &crtc) < 0) {
- LOGE("FBIO_WAITFORVSYNC failed");
+ ALOGE("FBIO_WAITFORVSYNC failed");
return 0;
}
#else
/* Standard Android way */
if (ioctl(m->framebuffer->fd, FBIOPUT_VSCREENINFO, &m->info) == -1) {
- LOGE("FBIOPUT_VSCREENINFO failed");
+ ALOGE("FBIOPUT_VSCREENINFO failed");
m->base.unlock(&m->base, buffer);
return -errno;
}
@@ -135,19 +135,19 @@
}
if (fd < 0) {
- LOGE("/dev/graphics/fb, /dev/fb Open fail");
+ ALOGE("/dev/graphics/fb, /dev/fb Open fail");
return -errno;
}
struct fb_fix_screeninfo finfo;
if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) == -1) {
- LOGE("Fail to get FB Screen Info");
+ ALOGE("Fail to get FB Screen Info");
return -errno;
}
struct fb_var_screeninfo info;
if (ioctl(fd, FBIOGET_VSCREENINFO, &info) == -1) {
- LOGE("First, Fail to get FB VScreen Info");
+ ALOGE("First, Fail to get FB VScreen Info");
return -errno;
}
@@ -195,19 +195,19 @@
if (ioctl(fd, FBIOPUT_VSCREENINFO, &info) == -1) {
info.yres_virtual = info.yres;
flags &= ~PAGE_FLIP;
- LOGW("FBIOPUT_VSCREENINFO failed, page flipping not supported");
+ ALOGW("FBIOPUT_VSCREENINFO failed, page flipping not supported");
}
if (info.yres_virtual < info.yres * 2) {
/* we need at least 2 for page-flipping */
info.yres_virtual = info.yres;
flags &= ~PAGE_FLIP;
- LOGW("page flipping not supported (yres_virtual=%d, requested=%d)",
+ ALOGW("page flipping not supported (yres_virtual=%d, requested=%d)",
info.yres_virtual, info.yres*2);
}
if (ioctl(fd, FBIOGET_VSCREENINFO, &info) == -1) {
- LOGE("Second, Fail to get FB VScreen Info");
+ ALOGE("Second, Fail to get FB VScreen Info");
return -errno;
}
@@ -231,7 +231,7 @@
float ydpi = (info.yres * 25.4f) / info.height;
float fps = refreshRate / 1000.0f;
- LOGI("using (fd=%d)\n"
+ ALOGI("using (fd=%d)\n"
"id = %s\n"
"xres = %d px\n"
"yres = %d px\n"
@@ -252,7 +252,7 @@
info.green.offset, info.green.length,
info.blue.offset, info.blue.length);
- LOGI("width = %d mm (%f dpi)\n"
+ ALOGI("width = %d mm (%f dpi)\n"
"height = %d mm (%f dpi)\n"
"refresh rate = %.2f Hz\n",
info.width, xdpi,
@@ -260,12 +260,12 @@
fps);
if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) == -1) {
- LOGE("Fail to get FScreen Info");
+ ALOGE("Fail to get FScreen Info");
return -errno;
}
if (finfo.smem_len <= 0) {
- LOGE("Invalid Value : finfo.smem_len");
+ ALOGE("Invalid Value : finfo.smem_len");
return -errno;
}
@@ -282,7 +282,7 @@
size_t fbSize = round_up_to_page_size(finfo.line_length * info.yres_virtual);
void* vaddr = mmap(0, fbSize, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
if (vaddr == MAP_FAILED) {
- LOGE("Error mapping the framebuffer (%s)", strerror(errno));
+ ALOGE("Error mapping the framebuffer (%s)", strerror(errno));
return -errno;
}
@@ -346,14 +346,14 @@
alloc_device_t* gralloc_device;
status = gralloc_open(module, &gralloc_device);
if (status < 0) {
- LOGE("Fail to Open gralloc device");
+ ALOGE("Fail to Open gralloc device");
return status;
}
private_module_t* m = (private_module_t*)module;
status = init_frame_buffer(m);
if (status < 0) {
- LOGE("Fail to init framebuffer");
+ ALOGE("Fail to init framebuffer");
gralloc_close(gralloc_device);
return status;
}
diff --git a/exynos5/hal/libgralloc_ump/gralloc_module.cpp b/exynos5/hal/libgralloc_ump/gralloc_module.cpp
index 8ca500b..d33e5d1 100644
--- a/exynos5/hal/libgralloc_ump/gralloc_module.cpp
+++ b/exynos5/hal/libgralloc_ump/gralloc_module.cpp
@@ -47,15 +47,15 @@
void *mappedAddress = ion_map(hnd->fd, size, 0);
if (mappedAddress == MAP_FAILED) {
- LOGE("Could not ion_map %s fd(%d)", strerror(errno), hnd->fd);
+ ALOGE("Could not ion_map %s fd(%d)", strerror(errno), hnd->fd);
return -errno;
}
hnd->base = intptr_t(mappedAddress) + hnd->offset;
- LOGD("gralloc_map() succeeded fd=%d, off=%d, size=%d, vaddr=%p",
+ ALOGD("gralloc_map() succeeded fd=%d, off=%d, size=%d, vaddr=%p",
hnd->fd, hnd->offset, hnd->size, mappedAddress);
} else {
- LOGE("In case of ION, It could not reach here!");
+ ALOGE("In case of ION, It could not reach here!");
}
}
*vaddr = (void*)hnd->base;
@@ -72,10 +72,10 @@
if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_ION) {
void* base = (void*)hnd->base;
size_t size = hnd->size;
- LOGD("unmapping from %p, size=%d", base, size);
+ ALOGD("unmapping from %p, size=%d", base, size);
if (ion_unmap(base, size) < 0)
- LOGE("Could not ion_unmap %s", strerror(errno));
+ ALOGE("Could not ion_unmap %s", strerror(errno));
ion_client_destroy(hnd->ion_client);
}
@@ -88,7 +88,7 @@
{
int status = -EINVAL;
- LOGI("Opening ARM Gralloc device");
+ ALOGI("Opening ARM Gralloc device");
if (!strcmp(name, GRALLOC_HARDWARE_GPU0))
status = alloc_device_open(module, name, device);
@@ -103,14 +103,14 @@
int retval = -EINVAL;
void *vaddr;
if (private_handle_t::validate(handle) < 0) {
- LOGE("Registering invalid buffer, returning error");
+ ALOGE("Registering invalid buffer, returning error");
return -EINVAL;
}
// if this handle was created in this process, then we keep it as is.
private_handle_t* hnd = (private_handle_t*)handle;
if (hnd->pid == getpid()) {
- LOGE("Invalid Process ID from Private_Handle");
+ ALOGE("Invalid Process ID from Private_Handle");
return 0;
}
@@ -119,7 +119,7 @@
ump_result res = ump_open();
if (res != UMP_OK) {
pthread_mutex_unlock(&s_map_lock);
- LOGE("Failed to open UMP library");
+ ALOGE("Failed to open UMP library");
return retval;
}
s_ump_is_open = 1;
@@ -137,18 +137,18 @@
pthread_mutex_unlock(&s_map_lock);
return 0;
} else {
- LOGE("Failed to map UMP handle");
+ ALOGE("Failed to map UMP handle");
}
ump_release(hnd->ump_mem_handle);
} else {
- LOGE("Failed to create UMP handle");
+ ALOGE("Failed to create UMP handle");
}
} else if (hnd->flags & private_handle_t::PRIV_FLAGS_USES_ION) {
hnd->ump_mem_handle = ump_handle_create_from_secure_id(hnd->ump_id);
retval = gralloc_map(module, handle, &vaddr);
} else {
- LOGE("registering non-UMP&ION buffer not supported");
+ ALOGE("registering non-UMP&ION buffer not supported");
}
pthread_mutex_unlock(&s_map_lock);
@@ -159,13 +159,13 @@
static int gralloc_unregister_buffer(gralloc_module_t const* module, buffer_handle_t handle)
{
if (private_handle_t::validate(handle) < 0) {
- LOGE("unregistering invalid buffer, returning error");
+ ALOGE("unregistering invalid buffer, returning error");
return -EINVAL;
}
private_handle_t* hnd = (private_handle_t*)handle;
- LOGE_IF(hnd->lockState & private_handle_t::LOCK_STATE_READ_MASK,
+ ALOGE_IF(hnd->lockState & private_handle_t::LOCK_STATE_READ_MASK,
"[unregister] handle %p still locked (state=%08x)", hnd, hnd->lockState);
/* never unmap buffers that were created in this process */
@@ -189,7 +189,7 @@
hnd->lockState = 0;
hnd->writeOwner = 0;
} else {
- LOGE("unregistering non-UMP buffer not supported");
+ ALOGE("unregistering non-UMP buffer not supported");
}
hnd->base = 0;
@@ -206,7 +206,7 @@
int usage, int l, int t, int w, int h, void** vaddr)
{
if (private_handle_t::validate(handle) < 0) {
- LOGE("Locking invalid buffer, returning error");
+ ALOGE("Locking invalid buffer, returning error");
return -EINVAL;
}
@@ -233,7 +233,7 @@
static int gralloc_unlock(gralloc_module_t const* module, buffer_handle_t handle)
{
if (private_handle_t::validate(handle) < 0) {
- LOGE("Unlocking invalid buffer, returning error");
+ ALOGE("Unlocking invalid buffer, returning error");
return -EINVAL;
}