This adds a context option to use DMA_RESV_USAGE_BOOKKEEP for userspace submissions, based on Christians TTM work. Disabling implicit sync is something we've wanted in radv for a while for resolving some corner cases. A more immediate thing that would be solved here is avoiding a bunch of implicit sync on GPU map/unmap operations as well, which helps with stutter around sparse maps/unmaps. This has seen a significant improvement in stutter in Forza Horizon 5 and Forza Horizon 4. (As games that had significant issues in sparse binding related stutter). I've been able to pass a full vulkan-cts run on navi21 with this. Userspace code for this is available at https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18032 and a branch for the kernel code is available at https://github.com/BNieuwenhuizen/linux/tree/no-implicit-sync-5.19 This is a follow-up on RFC series https://patchwork.freedesktop.org/series/104578/ . The main changes were: 1) Instead of replacing num_shared with usage, I'm just adding usage, since num_shared was actually needed. 2) We now agree that DMA_RESV_USAGE_BOOKKEEP is reasonable for this purpose. Please let me know if I missed anything, especially with the change to VM updates, as we went back and forth a ton of times on that. Bas Nieuwenhuizen (6): drm/ttm: Add usage to ttm_validate_buffer. drm/amdgpu: Add separate mode for syncing DMA_RESV_USAGE_BOOKKEEP. drm/amdgpu: Allow explicit sync for VM ops. drm/amdgpu: Refactor amdgpu_vm_get_pd_bo. drm/amdgpu: Add option to disable implicit sync for a context. drm/amdgpu: Bump amdgpu driver version. .../gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 16 +++++++--- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 20 +++++++++--- drivers/gpu/drm/amd/amdgpu/amdgpu_csa.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 32 +++++++++++++++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 12 ++++--- drivers/gpu/drm/amd/amdgpu/amdgpu_mes.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 11 ++++--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | 11 +++++-- drivers/gpu/drm/amd/amdgpu/amdgpu_sync.h | 4 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 5 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_cpu.c | 3 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm_sdma.c | 3 +- drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 1 + drivers/gpu/drm/qxl/qxl_release.c | 1 + drivers/gpu/drm/radeon/radeon_cs.c | 2 ++ drivers/gpu/drm/radeon/radeon_gem.c | 1 + drivers/gpu/drm/radeon/radeon_vm.c | 2 ++ drivers/gpu/drm/ttm/ttm_execbuf_util.c | 3 +- drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | 7 +++- drivers/gpu/drm/vmwgfx/vmwgfx_validation.c | 1 + include/drm/ttm/ttm_execbuf_util.h | 2 ++ include/uapi/drm/amdgpu_drm.h | 3 ++ 28 files changed, 122 insertions(+), 37 deletions(-) -- 2.37.1