From 9a9e06c425ea0a93f1553407d65fef2ab2d4f12b Mon Sep 17 00:00:00 2001 From: Juston Li Date: Tue, 13 Aug 2024 20:45:14 +0000 Subject: [Vulkan] Query global priority support for queue creation Setting up a device queue with a global queue priority above the system default requires sufficient privileges (SYS_NICE) otherwise queue creation will fail. SurfaceFlinger and system_server have SYS_NICE and will set priority to REALTIME. SysUI and Launcher take that as an indication they should request HIGH for better preemption strategy. However for upstream DRM drivers, we currently lack a way to grant them granular access to HIGH but not RT. For long term, the right way to do this is via drm specific cgroup for scheduling controls however this is currently being worked on upstream. In the meantime, instead of fatally crashing, we can query the global priorities supported before queue creation and if its not supported, drop the priority request and log a warning. Note this requires vkGetPhysicalDeviceQueueFamilyProperties2 which is provided by Vulkan 1.1 while the global priority query can be safely added to the pNext chain and will be ignored if VK_EXT_global_priority_query isn't supported. Bug: 343986434 Flag: com.android.graphics.hwui.flags.query_global_priority Test: UI comes up debug.renderengine.backend=skiavkthreaded Change-Id: I662c9ce3f3724e87690e25d260ee010340451c53 --- libs/hwui/Properties.h | 1 + 1 file changed, 1 insertion(+) (limited to 'libs/hwui/Properties.h') diff --git a/libs/hwui/Properties.h b/libs/hwui/Properties.h index db471527b861..6f84796fb11e 100644 --- a/libs/hwui/Properties.h +++ b/libs/hwui/Properties.h @@ -346,6 +346,7 @@ public: static bool hdr10bitPlus; static bool skipTelemetry; static bool resampleGainmapRegions; + static bool queryGlobalPriority; static int timeoutMultiplier; -- cgit v1.2.3-59-g8ed1b