May 2017
Beginner to intermediate
470 pages
10h 49m
English
Let's analyze the load_driver function, which is the one that finds and loads the OpenGL ES user space driver:
void *Loader::load_driver(const char* kind, egl_connection_t* cnx, uint32_t mask) { class MatchFile { public: static String8 find(const char* kind) { ... }; String8 absolutePath = MatchFile::find(kind); if (absolutePath.isEmpty()) { // this happens often, we don't want to log an error return 0; } const char* const driver_absolute_path = absolutePath.string(); void* dso = dlopen(driver_absolute_path, RTLD_NOW | RTLD_LOCAL); if (dso == 0) { const char* err = dlerror(); ALOGE("load_driver(%s): %s", driver_absolute_path, err? err:"unknown"); return 0; } ALOGD("loaded %s", driver_absolute_path); ...Read now
Unlock full access