aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-07-07 22:04:50 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-07-07 22:04:50 +0000
commit53b8e657c85a572ae8ab2d4e02007e667780d758 (patch)
tree073aae16a8f2bd9119bfad8cd3ad8abff32e39e7
parent2b7d954e2fa18c64d688f3ddb11f026382c0cfe2 (diff)
parent1374537c2af65d9ec610637a1a6a5efb9ffacf40 (diff)
downloadgoldfish-opengl-53b8e657c85a572ae8ab2d4e02007e667780d758.tar.gz
release-request-ccd04736-6e66-4825-a227-ecd69d8b5337-for-git_oc-mr1-release-4163697 snap-temp-L79500000080559163
Change-Id: I3d0eed9abcd9c1dd07f065972bf208e60e1a01dc
-rw-r--r--system/gralloc/gralloc.cpp28
1 files changed, 21 insertions, 7 deletions
diff --git a/system/gralloc/gralloc.cpp b/system/gralloc/gralloc.cpp
index ae0a3243..7c51667d 100644
--- a/system/gralloc/gralloc.cpp
+++ b/system/gralloc/gralloc.cpp
@@ -1486,6 +1486,15 @@ struct private_module_t HAL_MODULE_INFO_SYM = {
*
* If not, then load gralloc.default instead as a fallback.
*/
+
+#if __LP64__
+static const char kGrallocDefaultSystemPath[] = "/system/lib64/hw/gralloc.default.so";
+static const char kGrallocDefaultVendorPath[] = "/vendor/lib64/hw/gralloc.default.so";
+#else
+static const char kGrallocDefaultSystemPath[] = "/system/lib/hw/gralloc.default.so";
+static const char kGrallocDefaultVendorPath[] = "/vendor/lib/hw/gralloc.default.so";
+#endif
+
static void
fallback_init(void)
{
@@ -1499,12 +1508,17 @@ fallback_init(void)
if (atoi(prop) == 1) {
return;
}
- ALOGD("Emulator without host-side GPU emulation detected.");
-#if __LP64__
- module = dlopen("/vendor/lib64/hw/gralloc.default.so", RTLD_LAZY|RTLD_LOCAL);
-#else
- module = dlopen("/vendor/lib/hw/gralloc.default.so", RTLD_LAZY|RTLD_LOCAL);
-#endif
+ ALOGD("Emulator without host-side GPU emulation detected. "
+ "Loading gralloc.default.so from %s...",
+ kGrallocDefaultVendorPath);
+ module = dlopen(kGrallocDefaultVendorPath, RTLD_LAZY | RTLD_LOCAL);
+ if (!module) {
+ // vendor folder didn't work. try system
+ ALOGD("gralloc.default.so not found in /vendor. Trying %s...",
+ kGrallocDefaultSystemPath);
+ module = dlopen(kGrallocDefaultSystemPath, RTLD_LAZY | RTLD_LOCAL);
+ }
+
if (module != NULL) {
sFallback = reinterpret_cast<gralloc_module_t*>(dlsym(module, HAL_MODULE_INFO_SYM_AS_STR));
if (sFallback == NULL) {
@@ -1512,6 +1526,6 @@ fallback_init(void)
}
}
if (sFallback == NULL) {
- ALOGE("Could not find software fallback module!?");
+ ALOGE("FATAL: Could not find gralloc.default.so!");
}
}