EGL: Load updated EGL/GLES drivers
Because the driver namespace is stored in libgui, and libgui depends
on libEGL, this required a hack for libEGL to access the namespace.
See the comment added in GraphicsEnv.h for details; the summary is
that the libgui->libEGL dependency should go away, and then libEGL can
depend on libgui directly.
For system drivers, the loader would happily load anything named
lib{GLES,EGL,GLESv2,GLESv1_CM}_*.so in /vendor/lib[64]/egl, for
backward-compatibility with the old and no-longer-supported egl.cfg
system. However, it preferred unsuffixed names. That's not actually a
good idea, since the DT_SONAME would clash with the system libraries.
For updated drivers, we only look for suffixes from the
ro.hardware.egl and ro.board.platform system properties, similar to
the Vulkan and HAL library search. A future change (tied to a future
release) will do the same for system drivers.
Bug: 33531483
Test: Launch GLES apps w/ and w/o updated driver package
Change-Id: Ibfbb275629b0c6cf9c51314aea1361e81ff72d4b
diff --git a/libs/gui/GraphicsEnv.cpp b/libs/gui/GraphicsEnv.cpp
index ab824d3..68f0f98 100644
--- a/libs/gui/GraphicsEnv.cpp
+++ b/libs/gui/GraphicsEnv.cpp
@@ -75,3 +75,7 @@
}
} // namespace android
+
+extern "C" android_namespace_t* android_getDriverNamespace() {
+ return android::GraphicsEnv::getInstance().getDriverNamespace();
+}