Skip to content

Commit 5a20658

Browse files
chrisforbesGerrit Code Review
authored andcommitted
Merge changes I1e6c3c80,I4310618c into main
* changes: Fix updatable driver loading issue with Vulkan. Fix updatable driver loading issue with EGL.
2 parents 37961ec + 189318d commit 5a20658

2 files changed

Lines changed: 8 additions & 5 deletions

File tree

opengl/libs/EGL/Loader.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ void* Loader::open(egl_connection_t* cnx) {
262262
hnd = attempt_to_load_updated_driver(cnx);
263263

264264
// If updated driver apk is set but fail to load, abort here.
265-
LOG_ALWAYS_FATAL_IF(android::GraphicsEnv::getInstance().getDriverNamespace(),
265+
LOG_ALWAYS_FATAL_IF(android::GraphicsEnv::getInstance().getDriverNamespace() && !hnd,
266266
"couldn't find an OpenGL ES implementation from %s",
267267
android::GraphicsEnv::getInstance().getDriverPath().c_str());
268268
}

vulkan/libvulkan/driver.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -339,10 +339,13 @@ void Hal::UnloadBuiltinDriver() {
339339

340340
ALOGD("Unload builtin Vulkan driver.");
341341

342-
// Close the opened device
343-
int err = hal_.dev_->common.close(
344-
const_cast<struct hw_device_t*>(&hal_.dev_->common));
345-
ALOG_ASSERT(!err, "hw_device_t::close() failed.");
342+
if (hal_.dev_->common.close != nullptr)
343+
{
344+
// Close the opened device
345+
int err = hal_.dev_->common.close(
346+
const_cast<struct hw_device_t*>(&hal_.dev_->common));
347+
ALOG_ASSERT(!err, "hw_device_t::close() failed.");
348+
}
346349

347350
// Close the opened shared library in the hw_module_t
348351
android_unload_sphal_library(hal_.dev_->common.module->dso);

0 commit comments

Comments
 (0)