summaryrefslogtreecommitdiffstats
path: root/libgralloc/framebuffer.cpp
diff options
context:
space:
mode:
authorSaurabh Shah <saurshah@codeaurora.org>2014-05-19 16:48:53 -0700
committerSaurabh Shah <saurshah@codeaurora.org>2014-05-22 12:14:30 -0700
commit8f0ea6ff81bf39b546181e0055868a80d2a695df (patch)
tree9860b1487a67a1aebb0f5284960ccbca44fb2e32 /libgralloc/framebuffer.cpp
parent386f201efd08c9589f27f6b4003616630a819c33 (diff)
downloadandroid_hardware_qcom_display-8f0ea6ff81bf39b546181e0055868a80d2a695df.tar.gz
android_hardware_qcom_display-8f0ea6ff81bf39b546181e0055868a80d2a695df.tar.bz2
android_hardware_qcom_display-8f0ea6ff81bf39b546181e0055868a80d2a695df.zip
gralloc: Remove opaque types
Remove opaque types like size_t, uintptr_t, intptr_t to support 32bit and 64bit processes together. When a 64bit process creates a handle and a 32bit process validates the incoming ints against expected ints, opaque types lead to different and mismatching values. Always use unit64_t for base address for 32bit and 64bit SF. Use unsigned int for offset and size, since ION uses that. Change-Id: I7db5544556a8924f98010b965f837592e9f0b4ca
Diffstat (limited to 'libgralloc/framebuffer.cpp')
-rw-r--r--libgralloc/framebuffer.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libgralloc/framebuffer.cpp b/libgralloc/framebuffer.cpp
index d1f4207dc..ca11beae6 100644
--- a/libgralloc/framebuffer.cpp
+++ b/libgralloc/framebuffer.cpp
@@ -87,7 +87,8 @@ static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer)
reinterpret_cast<private_module_t*>(dev->common.module);
private_handle_t *hnd = static_cast<private_handle_t*>
(const_cast<native_handle_t*>(buffer));
- const size_t offset = hnd->base - m->framebuffer->base;
+ const unsigned int offset = (unsigned int) (hnd->base -
+ m->framebuffer->base);
m->info.activate = FB_ACTIVATE_VBL;
m->info.yoffset = (int)(offset / m->finfo.line_length);
if (ioctl(m->framebuffer->fd, FBIOPUT_VSCREENINFO, &m->info) == -1) {
@@ -204,7 +205,7 @@ int mapFrameBufferLocked(struct private_module_t* module)
}
//adreno needs 4k aligned offsets. Max hole size is 4096-1
- size_t size = roundUpToPageSize(info.yres * info.xres *
+ unsigned int size = roundUpToPageSize(info.yres * info.xres *
(info.bits_per_pixel/8));
/*
@@ -326,7 +327,7 @@ int mapFrameBufferLocked(struct private_module_t* module)
module->numBuffers = info.yres_virtual / info.yres;
module->bufferMask = 0;
//adreno needs page aligned offsets. Align the fbsize to pagesize.
- size_t fbSize = roundUpToPageSize(finfo.line_length * info.yres)*
+ unsigned int fbSize = roundUpToPageSize(finfo.line_length * info.yres)*
module->numBuffers;
module->framebuffer = new private_handle_t(fd, fbSize,
private_handle_t::PRIV_FLAGS_USES_ION,
@@ -338,7 +339,7 @@ int mapFrameBufferLocked(struct private_module_t* module)
close(fd);
return -errno;
}
- module->framebuffer->base = uintptr_t(vaddr);
+ module->framebuffer->base = uint64_t(vaddr);
memset(vaddr, 0, fbSize);
//Enable vsync
int enable = 1;