From c9d9155787d7222535296dd75c9298f5b5fddd7c Mon Sep 17 00:00:00 2001 From: Danylo Piliaiev Date: Tue, 23 Aug 2022 01:19:48 +0300 Subject: [PATCH] tu: Disable userspace iova allocations If BO is freed while kernel considers it busy, our VMA state gets desynchronized from kernel's VMA state because kernel waits until BO stops being busy. And whether BO is busy kernel decides at submission granularity. On the other hand in Vulkan we may free resource as soon as we know it won't be used. Not completely reverting the changes in hope that proper resolution would be found soon. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7106 Fixes: e23c4fbd9b6b95537ab00d19a034eaffe5fe86b0 ("tu: Switch to userspace iova allocations if kernel supports it") Signed-off-by: Danylo Piliaiev Part-of: --- src/freedreno/vulkan/tu_drm.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/freedreno/vulkan/tu_drm.c b/src/freedreno/vulkan/tu_drm.c index f4667ca8dfe..cb7cdeba137 100644 --- a/src/freedreno/vulkan/tu_drm.c +++ b/src/freedreno/vulkan/tu_drm.c @@ -817,8 +817,18 @@ tu_drm_device_init(struct tu_physical_device *device, goto fail; } - device->has_set_iova = !tu_drm_get_va_prop(device, &device->va_start, - &device->va_size); + /* + * device->has_set_iova = !tu_drm_get_va_prop(device, &device->va_start, + * &device->va_size); + * + * If BO is freed while kernel considers it busy, our VMA state gets + * desynchronized from kernel's VMA state, because kernel waits + * until BO stops being busy. And whether BO is busy decided at + * submission granularity. + * + * Disable this capability until solution is found. + */ + device->has_set_iova = false; struct stat st;