diff options
author | Monk Liu <Monk.Liu@amd.com> | 2017-01-09 02:54:32 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-01-27 11:13:20 -0500 |
commit | 2493664f0594d4140a5025de8e419ca2c16ccee9 (patch) | |
tree | da101f5fd861a50807e137104c89edb42d7d5fcd /drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |
parent | 4e4bbe7343a6d8269342189329b865355fe1bb51 (diff) |
drm/amdgpu:invoke CSA functions (v2)
Make sure the CSA is mapped.
v2: agd: rebase.
Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 43169ab61a78..8f852cb152f5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |||
@@ -649,6 +649,12 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) | |||
649 | goto out_suspend; | 649 | goto out_suspend; |
650 | } | 650 | } |
651 | 651 | ||
652 | if (amdgpu_sriov_vf(adev)) { | ||
653 | r = amdgpu_map_static_csa(adev, &fpriv->vm); | ||
654 | if (r) | ||
655 | goto out_suspend; | ||
656 | } | ||
657 | |||
652 | mutex_init(&fpriv->bo_list_lock); | 658 | mutex_init(&fpriv->bo_list_lock); |
653 | idr_init(&fpriv->bo_list_handles); | 659 | idr_init(&fpriv->bo_list_handles); |
654 | 660 | ||
@@ -687,6 +693,14 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev, | |||
687 | amdgpu_uvd_free_handles(adev, file_priv); | 693 | amdgpu_uvd_free_handles(adev, file_priv); |
688 | amdgpu_vce_free_handles(adev, file_priv); | 694 | amdgpu_vce_free_handles(adev, file_priv); |
689 | 695 | ||
696 | if (amdgpu_sriov_vf(adev)) { | ||
697 | /* TODO: how to handle reserve failure */ | ||
698 | BUG_ON(amdgpu_bo_reserve(adev->virt.csa_obj, false)); | ||
699 | amdgpu_vm_bo_rmv(adev, fpriv->vm.csa_bo_va); | ||
700 | fpriv->vm.csa_bo_va = NULL; | ||
701 | amdgpu_bo_unreserve(adev->virt.csa_obj); | ||
702 | } | ||
703 | |||
690 | amdgpu_vm_fini(adev, &fpriv->vm); | 704 | amdgpu_vm_fini(adev, &fpriv->vm); |
691 | 705 | ||
692 | idr_for_each_entry(&fpriv->bo_list_handles, list, handle) | 706 | idr_for_each_entry(&fpriv->bo_list_handles, list, handle) |