Commit 62eefd10 authored by Yifan Zhang's avatar Yifan Zhang Committed by Alex Deucher

drm/amdgpu: use CPU for page table update if SDMA is unavailable

avoid using SDMA if it is unavailable.
Signed-off-by: default avatarYifan Zhang <yifan1.zhang@amd.com>
Reviewed-by: default avatarTim Huang <tim.huang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 847e387e
...@@ -2397,6 +2397,7 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm) ...@@ -2397,6 +2397,7 @@ void amdgpu_vm_set_task_info(struct amdgpu_vm *vm)
int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
int32_t xcp_id) int32_t xcp_id)
{ {
struct amdgpu_ip_block *ip_block;
struct amdgpu_bo *root_bo; struct amdgpu_bo *root_bo;
struct amdgpu_bo_vm *root; struct amdgpu_bo_vm *root;
int r, i; int r, i;
...@@ -2426,6 +2427,11 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, ...@@ -2426,6 +2427,11 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm,
vm->use_cpu_for_update = !!(adev->vm_manager.vm_update_mode & vm->use_cpu_for_update = !!(adev->vm_manager.vm_update_mode &
AMDGPU_VM_USE_CPU_FOR_GFX); AMDGPU_VM_USE_CPU_FOR_GFX);
/* use CPU for page table update if SDMA is unavailable */
ip_block = amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_SDMA);
if (!ip_block || ip_block->status.valid == false)
vm->use_cpu_for_update = true;
DRM_DEBUG_DRIVER("VM update mode is %s\n", DRM_DEBUG_DRIVER("VM update mode is %s\n",
vm->use_cpu_for_update ? "CPU" : "SDMA"); vm->use_cpu_for_update ? "CPU" : "SDMA");
WARN_ONCE((vm->use_cpu_for_update && WARN_ONCE((vm->use_cpu_for_update &&
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment