May 2017
Beginner to intermediate
470 pages
10h 49m
English
As we can see from the gralloc_alloc function, when the usage bit is set to GRALLOC_USAGE_HW_FB, the gralloc_alloc_framebuffer function is called. The gralloc_alloc_framebuffer function will allocate the buffer from the framebuffer device:
static int gralloc_alloc_framebuffer_locked(alloc_device_t* dev, size_t size, int usage, buffer_handle_t* pHandle) { private_module_t* m = reinterpret_cast<private_module_t*>( dev->common.module); // allocate the framebuffer if (m->framebuffer == NULL) { // initialize the framebuffer, the framebuffer is mapped once // and forever. int err = mapFrameBufferLocked(m); if (err < 0) { return err; } } const uint32_t bufferMask = m->bufferMask; const uint32_t numBuffers ...Read now
Unlock full access