Skip to content

vulkan: android: Add static u_gralloc struct and getters

We want to move more Android-related functions into common code. Many of which require interactions with the gralloc. Therefore, struct u_gralloc must be kept in a common code.

vk_android_get_ugralloc() must be used for gralloc API calls.

vk_android_get_ugralloc_ptr() must be used in Vulkan HAL initialization code:

  • In XXXX_hal_open() to initialize the gralloc
  • In XXXX_hal_close() to destroy the gralloc

We do not put gralloc initialization into the generic code because we want it to be initialized by Zygote's Vulkan preloader, which may sometimes preload gralloc shared libraries, thus speeding up the initialization of user applications.

Edited by Roman Stratiienko

Merge request reports