为什么禁用,因为厂家不提供源码,这样就无法分析
回顾分析
参考:修改tiny4412_android源码禁用hwc和GPU_去除厂家gralloc_hwc模块_P
首先要去掉厂家提供的gralloc,hwcopser HAL模块,在这之前先回顾一下:android系统如何加载一个硬件模块,在之前的小节中,详细的讲解了:
int hw_get_module(const char *id, const struct hw_module_t **module)
{return hw_get_module_by_class(id, NULL, module);
}
在此我们简单的总结一下,如何获得HAL模块gralloc。hw_get_module函数时在哪里去查找呢?我们进入源代码:
hw_get_module(const char *id, const struct hw_module_t **module)hw_get_module_by_class(id, NULL, module);hw_module_exists(path, sizeof(path), name, "default")snprintf(path, path_len, "%s/%s.%s.so",HAL_LIBRARY_PATH3, name, subname);snprintf(path, path_len, "%s/%s.%s.so",HAL_LIBRARY_PATH2, name, subname);snprintf(path, path_len, "%s/%s.%s.so&