]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/gpuvm: drm_gpuvm_bo_obtain() requires lock and staged mode
authorAlice Ryhl <aliceryhl@google.com>
Thu, 8 Jan 2026 16:07:32 +0000 (16:07 +0000)
committerDanilo Krummrich <dakr@kernel.org>
Thu, 8 Jan 2026 17:05:16 +0000 (18:05 +0100)
commit9bf4ca1e699c272defe9636f9812ff33a448d650
tree366e899d4f6091292e211a93745c3d46af9c258c
parent44e4c88951fa9c73bfbde8269e443ea5343dd2af
drm/gpuvm: drm_gpuvm_bo_obtain() requires lock and staged mode

In commit 9ce4aef9a5b1 ("drm/gpuvm: take GEM lock inside
drm_gpuvm_bo_obtain_prealloc()") we update
drm_gpuvm_bo_obtain_prealloc() to take locks internally, which means
that it's only usable in immediate mode.

In this commit, we notice that drm_gpuvm_bo_obtain() requires you to use
staged mode. This means that we now have one variant of obtain for each
mode you might use gpuvm in.

To reflect this information, we add a warning about using it in
immediate mode, and to make the distinction clearer we rename the method
with a _locked() suffix so that it's clear that it requires the caller
to take the locks.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Alice Ryhl <aliceryhl@google.com>
Link: https://patch.msgid.link/20260108-gpuvm-rust-v2-2-dbd014005a0b@google.com
[ Slightly reword commit message to refer to commit 9ce4aef9a5b1
  ("drm/gpuvm: take GEM lock inside drm_gpuvm_bo_obtain_prealloc()").
  - Danilo ]
Signed-off-by: Danilo Krummrich <dakr@kernel.org>
drivers/gpu/drm/drm_gpuvm.c
drivers/gpu/drm/imagination/pvr_vm.c
drivers/gpu/drm/msm/msm_gem.h
drivers/gpu/drm/msm/msm_gem_vma.c
drivers/gpu/drm/nouveau/nouveau_uvmm.c
drivers/gpu/drm/xe/xe_vm.c
include/drm/drm_gpuvm.h