drm/imagination: vm: prevent duplicate drm_gpuvm_bo instances
authorDanilo Krummrich <dakr@redhat.com>
Fri, 24 Nov 2023 23:36:36 +0000 (00:36 +0100)
committerMaxime Ripard <mripard@kernel.org>
Tue, 28 Nov 2023 12:57:29 +0000 (13:57 +0100)
commit4aa89e8644d3b8879191911edea0b6a63ea9d6e2
treeb8fd4ed0e9086033b801ba0b626efaf67179257b
parent3519d77293fb74786a45811fa6b600db26c1b0be
drm/imagination: vm: prevent duplicate drm_gpuvm_bo instances

Use drm_gpuvm_bo_obtain() instead of drm_gpuvm_bo_create(). The latter
should only be used in conjunction with drm_gpuvm_bo_obtain_prealloc().

drm_gpuvm_bo_obtain() re-uses existing instances of a given VM and BO
combination, whereas drm_gpuvm_bo_create() would always create a new
instance of struct drm_gpuvm_bo and hence leave us with duplicates.

Fixes: ff5f643de0bf ("drm/imagination: Add GEM and VM related code")
Signed-off-by: Danilo Krummrich <dakr@redhat.com>
Reviewed-by: Donald Robson <donald.robson@imgtec.com>
Tested-by: Frank Binns <frank.binns@imgtec.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231124233650.152653-2-dakr@redhat.com
drivers/gpu/drm/imagination/pvr_vm.c