diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_object.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 14 | 
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index 2b6b61ed384c..795fa7445abe 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -79,11 +79,13 @@ static void amdgpu_bo_vm_destroy(struct ttm_buffer_object *tbo)  {  	struct amdgpu_device *adev = amdgpu_ttm_adev(tbo->bdev);  	struct amdgpu_bo *bo = ttm_to_amdgpu_bo(tbo); +	struct amdgpu_bo_vm *vmbo; +	vmbo = to_amdgpu_bo_vm(bo);  	/* in case amdgpu_device_recover_vram got NULL of bo->parent */ -	if (!list_empty(&bo->shadow_list)) { +	if (!list_empty(&vmbo->shadow_list)) {  		mutex_lock(&adev->shadow_list_lock); -		list_del_init(&bo->shadow_list); +		list_del_init(&vmbo->shadow_list);  		mutex_unlock(&adev->shadow_list_lock);  	} @@ -559,7 +561,6 @@ int amdgpu_bo_create(struct amdgpu_device *adev,  	if (bo == NULL)  		return -ENOMEM;  	drm_gem_private_object_init(adev_to_drm(adev), &bo->tbo.base, size); -	INIT_LIST_HEAD(&bo->shadow_list);  	bo->vm_bo = NULL;  	bo->preferred_domains = bp->preferred_domain ? bp->preferred_domain :  		bp->domain; @@ -689,6 +690,7 @@ int amdgpu_bo_create_vm(struct amdgpu_device *adev,  		return r;  	*vmbo_ptr = to_amdgpu_bo_vm(bo_ptr); +	INIT_LIST_HEAD(&(*vmbo_ptr)->shadow_list);  	return r;  } @@ -733,12 +735,12 @@ retry:   *   * Insert a BO to the shadow list.   */ -void amdgpu_bo_add_to_shadow_list(struct amdgpu_bo *bo) +void amdgpu_bo_add_to_shadow_list(struct amdgpu_bo_vm *vmbo)  { -	struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev); +	struct amdgpu_device *adev = amdgpu_ttm_adev(vmbo->bo.tbo.bdev);  	mutex_lock(&adev->shadow_list_lock); -	list_add_tail(&bo->shadow_list, &adev->shadow_list); +	list_add_tail(&vmbo->shadow_list, &adev->shadow_list);  	mutex_unlock(&adev->shadow_list_lock);  }  |