mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 05:16:01 +00:00
Non-Adreno round 7: bridge command-buffer guard, Venus Zink trace, PowerVR mangoapp, Xclipse label
- vkbridge server: every command buffer a device hands out is tracked; Begin, End (stream replay) and QueueSubmit refuse one it never allocated or has freed (VK_ERROR_DEVICE_LOST, logged) instead of passing it to the driver, where Mali's vkBeginCommandBuffer crashed the app (SIGSEGV 0x10, Steam's Zink on an Edge 60 and a Tab S11). - vkbridge server: a fault inside the driver while serving a request cuts that client off (SIGSEGV/SIGBUS guard per request) and leaves its objects alone; the app and the other clients carry on. Other faults go to the previous handler. - vkbridge server: the pipeline cache directory is copied; the JNI string it pointed at was freed (garbage in the cache path). - Venus: DROIDDECK_MALI_COMPAT_TRACE=1 makes the Mali compatibility layer log what an application queries before vkCreateDevice; a failed glprobe adds a traced run and vulkaninfo --summary under the same environment. - PowerVR: mangoapp draws with llvmpipe (Zink could not make it a swapchain and it crashed at every start). - Setup: an Xclipse GPU reads "Experimental: RADV or the system Xclipse driver", not the PowerVR line.
This commit is contained in:
1 parent
85c9442e23
commit
6621013aef
10 files changed
+324
-3
No files matched your search
@@ -1190,6 +1190,10 @@ BUSCONF
|
||||
# The loader's view first, then the variants that change what Zink asks of the device;
|
||||
# the first that starts is what the client gets.
|
||||
VK_LOADER_DEBUG=error,warn timeout 20 /usr/local/bin/droiddeck-glprobe 2>&1 | grep -v drirc | head -40 | sed 's/^/== glprobe (loader): /'
|
||||
# What Zink asked the device before it gave up (the Mali compatibility layer's trace), Mesa's
|
||||
# own debug output, and the device as Vulkan programs see it under the same environment.
|
||||
DROIDDECK_MALI_COMPAT_TRACE=1 MESA_DEBUG=1 LIBGL_DEBUG=verbose timeout 20 /usr/local/bin/droiddeck-glprobe 2>&1 | grep -v drirc | head -80 | sed 's/^/== glprobe (trace): /'
|
||||
command -v vulkaninfo >/dev/null 2>&1 && DROIDDECK_MALI_COMPAT_TRACE=1 timeout 20 vulkaninfo --summary 2>&1 | head -40 | sed 's/^/== glprobe (vulkaninfo): /'
|
||||
bl_gl_ok=
|
||||
for bl_variant in "ZINK_DEBUG=" "ZINK_DEBUG= ZINK_DESCRIPTORS=auto" "ZINK_DEBUG= LIBGL_KOPPER_DISABLE=true" "ZINK_DEBUG= DROIDDECK_MALI_COMPAT=0"; do
|
||||
if env $bl_variant timeout 20 /usr/local/bin/droiddeck-glprobe 2>&1 | grep -v drirc | head -20 | sed "s/^/== glprobe ($bl_variant): /"; [ "${PIPESTATUS[0]}" = 0 ]; then
|
||||
|
||||
@@ -18,4 +18,11 @@ if [ "$(wc -l < "$starts")" -gt 5 ]; then
|
||||
echo "mangoapp: started $(wc -l < "$starts") times in 60 s; the performance overlay stays off for this session" >&2
|
||||
exec sleep infinity
|
||||
fi
|
||||
# The system PowerVR route (BL_POWERVR_RENDER_NODE): Zink could not make mangoapp a swapchain there
|
||||
# ("zink: could not create swapchain", then GLXBadCurrentWindow) and it crashed at every start. The
|
||||
# overlay is a few text lines: llvmpipe draws it.
|
||||
if [ -n "${BL_POWERVR_RENDER_NODE:-}" ]; then
|
||||
export GALLIUM_DRIVER=llvmpipe LIBGL_ALWAYS_SOFTWARE=1
|
||||
unset MESA_LOADER_DRIVER_OVERRIDE LIBGL_KOPPER_DRI2
|
||||
fi
|
||||
LD_LIBRARY_PATH=/usr/local/lib/mangoapp${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} exec /usr/local/lib/mangoapp/mangoapp "$@"
|
||||
@@ -151,6 +151,18 @@ static bool wanted(void)
|
||||
return getenv("WINEPREFIX") != NULL;
|
||||
}
|
||||
|
||||
/* DROIDDECK_MALI_COMPAT_TRACE=1: what an application asks before it creates a device (Zink on a
|
||||
* Mali-G615 through Venus gave up before vkCreateDevice without a word). */
|
||||
static bool tracing(void)
|
||||
{
|
||||
static int on = -1;
|
||||
if (on < 0) {
|
||||
const char *v = getenv("DROIDDECK_MALI_COMPAT_TRACE");
|
||||
on = v && *v && strcmp(v, "0") != 0;
|
||||
}
|
||||
return on;
|
||||
}
|
||||
|
||||
static bool has_extension(struct instance *inst, VkPhysicalDevice physical_device, const char *name)
|
||||
{
|
||||
uint32_t count = 0;
|
||||
@@ -337,6 +349,13 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceFeatures2(VkPhysicalDevice ph
|
||||
inst->GetPhysicalDeviceFeatures2(physical_device, features);
|
||||
relink(dropped, dropped_count);
|
||||
report_features(&features->features, gaps);
|
||||
if (tracing()) {
|
||||
char chain[512] = "";
|
||||
size_t used = 0;
|
||||
for (VkBaseOutStructure *s = features->pNext; s && used + 16 < sizeof(chain); s = s->pNext)
|
||||
used += (size_t)snprintf(chain + used, sizeof(chain) - used, " %d", (int)s->sType);
|
||||
layer_log("trace: vkGetPhysicalDeviceFeatures2 (gaps 0x%x, %u structures held back), chain:%s", gaps, dropped_count, chain);
|
||||
}
|
||||
for (VkBaseOutStructure *s = features->pNext; s; s = s->pNext) {
|
||||
if (s->sType == VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ROBUSTNESS_2_FEATURES_EXT && (gaps & GAP_ROBUSTNESS2)) {
|
||||
((VkPhysicalDeviceRobustness2FeaturesEXT *)s)->robustBufferAccess2 = VK_TRUE;
|
||||
@@ -362,6 +381,10 @@ static VKAPI_ATTR void VKAPI_CALL GetPhysicalDeviceProperties2(VkPhysicalDevice
|
||||
struct instance *inst = instance_from_handle(physical_device);
|
||||
inst->GetPhysicalDeviceProperties2(physical_device, properties);
|
||||
report_limits(&properties->properties.limits, physical_device_gaps(inst, physical_device));
|
||||
if (tracing())
|
||||
layer_log("trace: vkGetPhysicalDeviceProperties2: %s, Vulkan %u.%u.%u, type %d", properties->properties.deviceName,
|
||||
VK_API_VERSION_MAJOR(properties->properties.apiVersion), VK_API_VERSION_MINOR(properties->properties.apiVersion),
|
||||
VK_API_VERSION_PATCH(properties->properties.apiVersion), (int)properties->properties.deviceType);
|
||||
}
|
||||
|
||||
/* The extensions the layer stands in for, added to the driver's list. */
|
||||
@@ -391,6 +414,8 @@ static VKAPI_ATTR VkResult VKAPI_CALL EnumerateDeviceExtensionProperties(VkPhysi
|
||||
inst->EnumerateDeviceExtensionProperties(physical_device, NULL, &own, all);
|
||||
memcpy(all + own, extra, extra_count * sizeof(*extra));
|
||||
uint32_t total = own + extra_count;
|
||||
if (tracing())
|
||||
layer_log("trace: vkEnumerateDeviceExtensionProperties: %u from the driver, %u added by the layer", own, extra_count);
|
||||
uint32_t n = *count < total ? *count : total;
|
||||
memcpy(properties, all, n * sizeof(*all));
|
||||
free(all);
|
||||
@@ -411,6 +436,10 @@ static VKAPI_ATTR VkResult VKAPI_CALL CreateInstance(const VkInstanceCreateInfo
|
||||
|
||||
PFN_vkCreateInstance create = (PFN_vkCreateInstance)gipa(VK_NULL_HANDLE, "vkCreateInstance");
|
||||
VkResult result = create(info, allocator, instance);
|
||||
if (tracing())
|
||||
layer_log("trace: vkCreateInstance for %s (API %u.%u): %d, layer %s", info->pApplicationInfo && info->pApplicationInfo->pApplicationName ?
|
||||
info->pApplicationInfo->pApplicationName : "?", info->pApplicationInfo ? VK_API_VERSION_MAJOR(info->pApplicationInfo->apiVersion) : 0,
|
||||
info->pApplicationInfo ? VK_API_VERSION_MINOR(info->pApplicationInfo->apiVersion) : 0, (int)result, wanted() ? "active" : "idle");
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
||||
|
||||
Reference in new issue
Block a user