diff options
author | Junwei Zhang <Jerry.Zhang@amd.com> | 2017-01-16 00:59:01 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-03-29 23:52:56 -0400 |
commit | b85891bd6d1bf887b3398f4c44b7a30b37f4485e (patch) | |
tree | cdc0d0f596927a2c869866bcbfd29007e5ce44d1 /drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |
parent | 284710fa6c3a5fddbc0f8c6b3a07861a312c18d2 (diff) |
drm/amdgpu: IOCTL interface for PRT support v4
Till GFX8 we can only enable PRT support globally, but with the next hardware
generation we can do this on a per page basis.
Keep the interface consistent by adding PRT mappings and enable
support globally on current hardware when the first mapping is made.
v2: disable PRT support delayed and on all error paths
v3: PRT and other permissions are mutal exclusive,
PRT mappings don't need a BO.
v4: update PRT mappings durign CS as well, make va_flags 64bit
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@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 | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index 61d94c745672..49f93ee019e3 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |||
@@ -655,6 +655,14 @@ int amdgpu_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv) | |||
655 | goto out_suspend; | 655 | goto out_suspend; |
656 | } | 656 | } |
657 | 657 | ||
658 | fpriv->prt_va = amdgpu_vm_bo_add(adev, &fpriv->vm, NULL); | ||
659 | if (!fpriv->prt_va) { | ||
660 | r = -ENOMEM; | ||
661 | amdgpu_vm_fini(adev, &fpriv->vm); | ||
662 | kfree(fpriv); | ||
663 | goto out_suspend; | ||
664 | } | ||
665 | |||
658 | if (amdgpu_sriov_vf(adev)) { | 666 | if (amdgpu_sriov_vf(adev)) { |
659 | r = amdgpu_map_static_csa(adev, &fpriv->vm); | 667 | r = amdgpu_map_static_csa(adev, &fpriv->vm); |
660 | if (r) | 668 | if (r) |
@@ -699,6 +707,8 @@ void amdgpu_driver_postclose_kms(struct drm_device *dev, | |||
699 | amdgpu_uvd_free_handles(adev, file_priv); | 707 | amdgpu_uvd_free_handles(adev, file_priv); |
700 | amdgpu_vce_free_handles(adev, file_priv); | 708 | amdgpu_vce_free_handles(adev, file_priv); |
701 | 709 | ||
710 | amdgpu_vm_bo_rmv(adev, fpriv->prt_va); | ||
711 | |||
702 | if (amdgpu_sriov_vf(adev)) { | 712 | if (amdgpu_sriov_vf(adev)) { |
703 | /* TODO: how to handle reserve failure */ | 713 | /* TODO: how to handle reserve failure */ |
704 | BUG_ON(amdgpu_bo_reserve(adev->virt.csa_obj, false)); | 714 | BUG_ON(amdgpu_bo_reserve(adev->virt.csa_obj, false)); |