venus: limit second queue emulation to android framework

A proper emulation of a second queue requires handling of
wait-before-signal behavior of timeline semaphore. It's doable in Venus
but not that much useful since 1.4 requires a second transfer queue
family if not implementing hostImageCopy. So this change has limited
the second queue emulation as a workaround for android framework on
Android 14 and above.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33698>
This commit is contained in:
Yiwei Zhang 2025-02-23 15:34:20 -08:00 committed by Marge Bot
parent 0fd70ee9de
commit ac13146092
2 changed files with 7 additions and 15 deletions

View file

@ -722,21 +722,12 @@ vn_physical_device_init_queue_family_properties(
/* Starting from Android 14 (Android U), framework HWUI has required a
* second graphics queue to avoid racing between webview and skiavk.
*/
static const bool require_second_queue = true;
#else
/* Per 1.4 spec of VK_EXT_host_image_copy promotion:
*
* A Vulkan 1.4 implementation that has a VK_QUEUE_GRAPHICS_BIT queue must
* support either:
* - the hostImageCopy feature; or
* - an additional queue that supports VK_QUEUE_TRANSFER_BIT.
*
* Additionally, all queues supporting VK_QUEUE_GRAPHICS_BIT or
* VK_QUEUE_COMPUTE_BIT must also advertise VK_QUEUE_TRANSFER_BIT.
*/
const char *engine_name = instance->base.base.app_info.engine_name;
const bool require_second_queue =
physical_dev->base.base.properties.apiVersion >= VK_API_VERSION_1_4 &&
!physical_dev->base.base.supported_extensions.EXT_host_image_copy;
engine_name && strcmp(engine_name, "android framework") == 0;
;
#else
static const bool require_second_queue = false;
#endif
physical_dev->emulate_second_queue = -1;
for (uint32_t i = 0; i < count; i++) {

View file

@ -85,7 +85,8 @@ struct vn_physical_device {
uint32_t queue_family_count;
bool sparse_binding_disabled;
/* Track the queue family index to emulate a second queue. -1 means no
* emulation is needed.
* emulation is needed. To be noted that the emulation is a workaround for
* Android 14+ UI framework and it does not handle wait-before-signal.
*/
int emulate_second_queue;