summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Peiyong Lin <lpy@google.com> 2020-01-10 23:54:42 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-01-10 23:54:42 +0000
commitfa6fe1af069bb14513950fb5a79ffcb0b9c43fa4 (patch)
tree7fc5e48e6beaf2c5817f8e72381af31dc55658a1
parent438e256134ccbfa5d9cfa78e4f62470ff0cbccd4 (diff)
parentdb3ed6e69797afa5735b5d7a3b0d0f788a522284 (diff)
Merge "Don't fall back to system driver when driver apk fails."
-rw-r--r--libs/graphicsenv/GraphicsEnv.cpp4
-rw-r--r--libs/graphicsenv/include/graphicsenv/GraphicsEnv.h1
-rw-r--r--opengl/libs/EGL/Loader.cpp5
3 files changed, 10 insertions, 0 deletions
diff --git a/libs/graphicsenv/GraphicsEnv.cpp b/libs/graphicsenv/GraphicsEnv.cpp
index f07c23132d..befabee66d 100644
--- a/libs/graphicsenv/GraphicsEnv.cpp
+++ b/libs/graphicsenv/GraphicsEnv.cpp
@@ -611,6 +611,10 @@ android_namespace_t* GraphicsEnv::getDriverNamespace() {
return mDriverNamespace;
}
+std::string GraphicsEnv::getDriverPath() const {
+ return mDriverPath;
+}
+
android_namespace_t* GraphicsEnv::getAngleNamespace() {
std::lock_guard<std::mutex> lock(mNamespaceMutex);
diff --git a/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h b/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h
index 2219074ec0..22a2332589 100644
--- a/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h
+++ b/libs/graphicsenv/include/graphicsenv/GraphicsEnv.h
@@ -58,6 +58,7 @@ public:
void setDriverPathAndSphalLibraries(const std::string path, const std::string sphalLibraries);
// Get the updatable driver namespace.
android_namespace_t* getDriverNamespace();
+ std::string getDriverPath() const;
/*
* Apis for GpuStats
diff --git a/opengl/libs/EGL/Loader.cpp b/opengl/libs/EGL/Loader.cpp
index e1432608c9..06944bb5c6 100644
--- a/opengl/libs/EGL/Loader.cpp
+++ b/opengl/libs/EGL/Loader.cpp
@@ -238,6 +238,11 @@ void* Loader::open(egl_connection_t* cnx)
bool failToLoadFromDriverSuffixProperty = false;
if (!hnd) {
+ // If updated driver apk is set but fail to load, abort here.
+ if (android::GraphicsEnv::getInstance().getDriverNamespace()) {
+ LOG_ALWAYS_FATAL("couldn't find an OpenGL ES implementation from %s",
+ android::GraphicsEnv::getInstance().getDriverPath().c_str());
+ }
// Finally, try to load system driver, start by searching for the library name appended by
// the system properties of the GLES userspace driver in both locations.
// i.e.: