May 2017
Beginner to intermediate
470 pages
10h 49m
English
For the implementation of the FB0 device, we will look at the post method as we did for the default Gralloc module analysis. This is implemented in the fb_post function and we can look at the implementation as follows:
static int fb_post(struct framebuffer_device_t* dev, buffer_handle_t buffer) { fb_device_t *fbdev = (fb_device_t *)dev; cb_handle_t *cb = (cb_handle_t *)buffer; if (!fbdev || !cb_handle_t::validate(cb) || !cb->canBePosted()) { return -EINVAL; } // Make sure we have host connection DEFINE_AND_VALIDATE_HOST_CONNECTION; // increment the post count of the buffer intptr_t *postCountPtr = (intptr_t *)cb->ashmemBase; if (!postCountPtr) { // This should not happen return -EINVAL; } (*postCountPtr)++; ...Read now
Unlock full access