summaryrefslogtreecommitdiff
path: root/modules/gralloc/framebuffer.cpp
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2009-06-09 18:55:49 -0700
committerMathias Agopian <mathias@google.com>2009-06-09 20:50:34 -0700
commit5115665397e5f5be5a5d464bc22b70b023d243d9 (patch)
treec92318c531a9a8222242e98ef9ff706ecf0943fe /modules/gralloc/framebuffer.cpp
parent5b44567e001b4ba6ef0067aa3eb420c1d7dc3ef7 (diff)
with the new lock/unlock API we don't really mean reference counting on mmap/munmap because we're guaranteed to map the buffers only once within a process.
no need to track all handles anymore, which simplifies the code a lot.
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 d885ae8f..248a2fc5 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;
}