Vulkan: unload builtin driver to reload updated driver if needed
Android historically preloads GL driver in Zygote to speed up app launch
time and avoid the duplicate extra memory for each process loading the
graphics driver. In Android 10, we landed GL driver unloading mechanism
to ship updatable driver and ANGLE without perf overhead on the rest of
the system.
To get prepared for the HWUI Vulkan backend being turned on as the
default renderer for UI componments, this CL will do the same to the
Vulkan driver to preload it in Zygote and unload so to reload updated
driver if needed.
Bug: 135536511
Test: atest CtsUiRenderingTestCases no regression on VK backend
Change-Id: I2909f6ecc4f011b1f3670aacdf817ed3b6e9a487
diff --git a/vulkan/include/hardware/hwvulkan.h b/vulkan/include/hardware/hwvulkan.h
index 9e9a14d..98bc8e3 100644
--- a/vulkan/include/hardware/hwvulkan.h
+++ b/vulkan/include/hardware/hwvulkan.h
@@ -54,8 +54,9 @@
/* A hwvulkan_device_t corresponds to an ICD on other systems. Currently there
* can only be one on a system (HWVULKAN_DEVICE_0). It is opened once per
* process when the Vulkan API is first used; the hw_device_t::close() function
- * is never called. Any non-trivial resource allocation should be done when
- * the VkInstance is created rather than when the hwvulkan_device_t is opened.
+ * is called upon driver unloading. Any non-trivial resource allocation should
+ * be done when the VkInstance is created rather than when the hwvulkan_device_t
+ * is opened.
*/
typedef struct hwvulkan_device_t {
struct hw_device_t common;