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.
This commit is contained in:
Mathias Agopian
2009-06-09 18:55:49 -07:00
parent 5b44567e00
commit 5115665397
3 changed files with 78 additions and 306 deletions

View File

@@ -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;
}