May 2017
Beginner to intermediate
470 pages
10h 49m
English
We have talked about HAL data structures hw_module_t and hw_module_methods_t for the Gralloc module. The last one, hw_device_t, is initialized in the open method of the Gralloc HAL module. Now we can look at the open method of the Gralloc module as follows:
int gralloc_device_open(const hw_module_t* module, const char* name, hw_device_t** device) { int status = -EINVAL; if (!strcmp(name, GRALLOC_HARDWARE_GPU0)) { gralloc_context_t *dev; dev = (gralloc_context_t*)malloc(sizeof(*dev)); memset(dev, 0, sizeof(*dev)); dev->device.common.tag = HARDWARE_DEVICE_TAG; dev->device.common.version = 0; dev->device.common.module = const_cast<hw_module_t*>(module); dev->device.common.close = gralloc_close; dev->device.alloc ...Read now
Unlock full access