diff options
| author | Christian König <christian.koenig@amd.com> | 2017-08-24 13:32:55 +0300 | 
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2017-08-29 22:27:56 +0300 | 
| commit | 34d7be5dc28041b95254da517fd0f0f740544ece (patch) | |
| tree | 3cb6ab57a8e2e59347216a2daf24e93068c6c3e2 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
| parent | 87f64a76b38acaa081b2bc46c3169884b9ccd6f2 (diff) | |
| download | linux-34d7be5dc28041b95254da517fd0f0f740544ece.tar.xz | |
drm/amdgpu: fix and cleanup VM ready check
Stop checking the mapped BO itself, cause that one is
certainly not a page table.
Additional to that move the code into amdgpu_vm.c
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 33 | 
1 files changed, 2 insertions, 31 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 7171968f261e..9b1b6bdd4841 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -127,35 +127,6 @@ int amdgpu_gem_object_open(struct drm_gem_object *obj,  	return 0;  } -static int amdgpu_gem_vm_check(void *param, struct amdgpu_bo *bo) -{ -	/* if anything is swapped out don't swap it in here, -	   just abort and wait for the next CS */ -	if (!amdgpu_bo_gpu_accessible(bo)) -		return -ERESTARTSYS; - -	if (bo->shadow && !amdgpu_bo_gpu_accessible(bo->shadow)) -		return -ERESTARTSYS; - -	return 0; -} - -static bool amdgpu_gem_vm_ready(struct amdgpu_device *adev, -				struct amdgpu_vm *vm, -				struct list_head *list) -{ -	struct ttm_validate_buffer *entry; - -	list_for_each_entry(entry, list, head) { -		struct amdgpu_bo *bo = -			container_of(entry->bo, struct amdgpu_bo, tbo); -		if (amdgpu_gem_vm_check(NULL, bo)) -			return false; -	} - -	return !amdgpu_vm_validate_pt_bos(adev, vm, amdgpu_gem_vm_check, NULL); -} -  void amdgpu_gem_object_close(struct drm_gem_object *obj,  			     struct drm_file *file_priv)  { @@ -189,7 +160,7 @@ void amdgpu_gem_object_close(struct drm_gem_object *obj,  	if (bo_va && --bo_va->ref_count == 0) {  		amdgpu_vm_bo_rmv(adev, bo_va); -		if (amdgpu_gem_vm_ready(adev, vm, &list)) { +		if (amdgpu_vm_ready(adev, vm)) {  			struct dma_fence *fence = NULL;  			r = amdgpu_vm_clear_freed(adev, vm, &fence); @@ -513,7 +484,7 @@ static void amdgpu_gem_va_update_vm(struct amdgpu_device *adev,  {  	int r = -ERESTARTSYS; -	if (!amdgpu_gem_vm_ready(adev, vm, list)) +	if (!amdgpu_vm_ready(adev, vm))  		goto error;  	r = amdgpu_vm_update_directories(adev, vm); | 
