diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 14 | 
1 files changed, 6 insertions, 8 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 82823d9a8ba8..22c989bca751 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -603,8 +603,6 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,  		e->tv.num_shared = 2;  	amdgpu_bo_list_get_list(p->bo_list, &p->validated); -	if (p->bo_list->first_userptr != p->bo_list->num_entries) -		p->mn = amdgpu_mn_get(p->adev, AMDGPU_MN_TYPE_GFX);  	INIT_LIST_HEAD(&duplicates);  	amdgpu_vm_get_pd_bo(&fpriv->vm, &p->validated, &p->vm_pd); @@ -1287,11 +1285,11 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,  	if (r)  		goto error_unlock; -	/* No memory allocation is allowed while holding the mn lock. -	 * p->mn is hold until amdgpu_cs_submit is finished and fence is added -	 * to BOs. +	/* No memory allocation is allowed while holding the notifier lock. +	 * The lock is held until amdgpu_cs_submit is finished and fence is +	 * added to BOs.  	 */ -	amdgpu_mn_lock(p->mn); +	mutex_lock(&p->adev->notifier_lock);  	/* If userptr are invalidated after amdgpu_cs_parser_bos(), return  	 * -EAGAIN, drmIoctl in libdrm will restart the amdgpu_cs_ioctl. @@ -1334,13 +1332,13 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,  	amdgpu_vm_move_to_lru_tail(p->adev, &fpriv->vm);  	ttm_eu_fence_buffer_objects(&p->ticket, &p->validated, p->fence); -	amdgpu_mn_unlock(p->mn); +	mutex_unlock(&p->adev->notifier_lock);  	return 0;  error_abort:  	drm_sched_job_cleanup(&job->base); -	amdgpu_mn_unlock(p->mn); +	mutex_unlock(&p->adev->notifier_lock);  error_unlock:  	amdgpu_job_free(job); | 
