diff options
| author | Alex Deucher <alexander.deucher@amd.com> | 2018-07-25 16:11:34 -0400 |
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2018-07-27 10:07:44 -0400 |
| commit | f1e582ebfd703ea01dc4caf4d339b7c84ec3ff29 (patch) | |
| tree | 56bfd3cd4840cf6dee41cbbf77d468823065872b /drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c | |
| parent | d04cc604a66b07eff8fce824fb6c0fdc0875d2e3 (diff) | |
drm/amdgpu: implement harvesting support for UVD 7.2 (v3)
Properly handle cases where one or more instance of the IP
block may be harvested.
v2: make sure ip_num_rings is initialized amdgpu_queue_mgr.c
v3: rebase on Christian's UVD changes, drop unused var
Reviewed-by: James Zhu <James.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c index d8357290ad09..a172bba32b45 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_queue_mgr.c | |||
| @@ -214,7 +214,7 @@ int amdgpu_queue_mgr_map(struct amdgpu_device *adev, | |||
| 214 | u32 hw_ip, u32 instance, u32 ring, | 214 | u32 hw_ip, u32 instance, u32 ring, |
| 215 | struct amdgpu_ring **out_ring) | 215 | struct amdgpu_ring **out_ring) |
| 216 | { | 216 | { |
| 217 | int r, ip_num_rings; | 217 | int i, r, ip_num_rings = 0; |
| 218 | struct amdgpu_queue_mapper *mapper = &mgr->mapper[hw_ip]; | 218 | struct amdgpu_queue_mapper *mapper = &mgr->mapper[hw_ip]; |
| 219 | 219 | ||
| 220 | if (!adev || !mgr || !out_ring) | 220 | if (!adev || !mgr || !out_ring) |
| @@ -243,14 +243,21 @@ int amdgpu_queue_mgr_map(struct amdgpu_device *adev, | |||
| 243 | ip_num_rings = adev->sdma.num_instances; | 243 | ip_num_rings = adev->sdma.num_instances; |
| 244 | break; | 244 | break; |
| 245 | case AMDGPU_HW_IP_UVD: | 245 | case AMDGPU_HW_IP_UVD: |
| 246 | ip_num_rings = adev->uvd.num_uvd_inst; | 246 | for (i = 0; i < adev->uvd.num_uvd_inst; i++) { |
| 247 | if (!(adev->uvd.harvest_config & (1 << i))) | ||
| 248 | ip_num_rings++; | ||
| 249 | } | ||
| 247 | break; | 250 | break; |
| 248 | case AMDGPU_HW_IP_VCE: | 251 | case AMDGPU_HW_IP_VCE: |
| 249 | ip_num_rings = adev->vce.num_rings; | 252 | ip_num_rings = adev->vce.num_rings; |
| 250 | break; | 253 | break; |
| 251 | case AMDGPU_HW_IP_UVD_ENC: | 254 | case AMDGPU_HW_IP_UVD_ENC: |
| 255 | for (i = 0; i < adev->uvd.num_uvd_inst; i++) { | ||
| 256 | if (!(adev->uvd.harvest_config & (1 << i))) | ||
| 257 | ip_num_rings++; | ||
| 258 | } | ||
| 252 | ip_num_rings = | 259 | ip_num_rings = |
| 253 | adev->uvd.num_enc_rings * adev->uvd.num_uvd_inst; | 260 | adev->uvd.num_enc_rings * ip_num_rings; |
| 254 | break; | 261 | break; |
| 255 | case AMDGPU_HW_IP_VCN_DEC: | 262 | case AMDGPU_HW_IP_VCN_DEC: |
| 256 | ip_num_rings = 1; | 263 | ip_num_rings = 1; |
