summaryrefslogtreecommitdiffstats
path: root/modules/gralloc/framebuffer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gralloc/framebuffer.cpp')
-rw-r--r--modules/gralloc/framebuffer.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/modules/gralloc/framebuffer.cpp b/modules/gralloc/framebuffer.cpp
index d885ae8..248a2fc 100644
--- a/modules/gralloc/framebuffer.cpp
+++ b/modules/gralloc/framebuffer.cpp
@@ -296,10 +296,13 @@ int mapFrameBufferLocked(struct private_module_t* module)
module->numBuffers = info.yres_virtual / info.yres;
module->bufferMask = 0;
- void* vaddr;
- gralloc_map(&module->base, module->framebuffer, &vaddr);
+ 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));
+ return -errno;
+ }
+ module->framebuffer->base = intptr_t(vaddr);
memset(vaddr, 0, fbSize);
-
return 0;
}