drm/amdkfd: simplify vm_validate_pt_pd_bos
authorLang Yu <Lang.Yu@amd.com>
Tue, 7 Jun 2022 07:58:23 +0000 (15:58 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 5 Jul 2022 20:09:55 +0000 (16:09 -0400)
commit4bdb9d6501763e83bacbf26846754c567773a1fb
tree77fcec2153b7cdf4f50f52046282a64126ffa711
parentcfb979f71736361ec564d47d0a41f07e09983e32
drm/amdkfd: simplify vm_validate_pt_pd_bos

We don't need to validate and map root PD specially here,
it would be validated and mapped by amdgpu_vm_validate_pt_bos
if it is evicted.

The special case is when turning a GFX VM to a compute VM,
if vm_update_mode changed, we should make sure root PD gets
mapped. So just map root PD after updating vm->update_funcs
in amdgpu_vm_make_compute whether the vm_update_mode changed
or not.

v3:
 - Add some comments suggested by Christian.

v2:
 - Don't rename vm_validate_pt_pd_bos and make it public.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c