mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 06:30:11 +01:00
anv: free up hwvulkan_device_t upon driver unloading
Per <hardware/hwvulkan.h>, the hw_device_t::close() function is called upon driver unloading. The behavior has been like this since Android 10. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35561>
This commit is contained in:
parent
0c141ef492
commit
896bda5143
1 changed files with 7 additions and 2 deletions
|
|
@ -96,8 +96,13 @@ anv_hal_open(const struct hw_module_t* mod, const char* id,
|
|||
static int
|
||||
anv_hal_close(struct hw_device_t *dev)
|
||||
{
|
||||
/* hwvulkan.h claims that hw_device_t::close() is never called. */
|
||||
return -1;
|
||||
/* the hw_device_t::close() function is called upon driver unloading */
|
||||
assert(dev->version == HWVULKAN_DEVICE_API_VERSION_0_1);
|
||||
assert(dev->module == &HAL_MODULE_INFO_SYM.common);
|
||||
|
||||
hwvulkan_device_t *hal_dev = container_of(dev, hwvulkan_device_t, common);
|
||||
free(hal_dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if ANDROID_API_LEVEL >= 26
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue