diff options
author | Tianci.Yin <tianci.yin@amd.com> | 2019-08-27 22:03:40 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-08-29 16:52:32 -0400 |
commit | 12842d02c7fde1989616a490799bf8f86695b54a (patch) | |
tree | 3cc889a61338ca9608ab021ab6048f0d42bdfc68 | |
parent | 994dcfaa7ee321a23ec398f6b0e709f11ab2f577 (diff) |
drm/amdgpu/psp: keep TMR in visible vram region for SRIOV
Fix compute ring test failure in sriov scenario.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Tianci.Yin <tianci.yin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index f06f5ef0ca4b..4d71537a960d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | |||
@@ -239,6 +239,8 @@ static int psp_tmr_init(struct psp_context *psp) | |||
239 | { | 239 | { |
240 | int ret; | 240 | int ret; |
241 | int tmr_size; | 241 | int tmr_size; |
242 | void *tmr_buf; | ||
243 | void **pptr; | ||
242 | 244 | ||
243 | /* | 245 | /* |
244 | * According to HW engineer, they prefer the TMR address be "naturally | 246 | * According to HW engineer, they prefer the TMR address be "naturally |
@@ -261,9 +263,10 @@ static int psp_tmr_init(struct psp_context *psp) | |||
261 | } | 263 | } |
262 | } | 264 | } |
263 | 265 | ||
266 | pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL; | ||
264 | ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE, | 267 | ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE, |
265 | AMDGPU_GEM_DOMAIN_VRAM, | 268 | AMDGPU_GEM_DOMAIN_VRAM, |
266 | &psp->tmr_bo, &psp->tmr_mc_addr, NULL); | 269 | &psp->tmr_bo, &psp->tmr_mc_addr, pptr); |
267 | 270 | ||
268 | return ret; | 271 | return ret; |
269 | } | 272 | } |
@@ -1206,6 +1209,8 @@ static int psp_hw_fini(void *handle) | |||
1206 | { | 1209 | { |
1207 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 1210 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
1208 | struct psp_context *psp = &adev->psp; | 1211 | struct psp_context *psp = &adev->psp; |
1212 | void *tmr_buf; | ||
1213 | void **pptr; | ||
1209 | 1214 | ||
1210 | if (adev->gmc.xgmi.num_physical_nodes > 1 && | 1215 | if (adev->gmc.xgmi.num_physical_nodes > 1 && |
1211 | psp->xgmi_context.initialized == 1) | 1216 | psp->xgmi_context.initialized == 1) |
@@ -1216,7 +1221,8 @@ static int psp_hw_fini(void *handle) | |||
1216 | 1221 | ||
1217 | psp_ring_destroy(psp, PSP_RING_TYPE__KM); | 1222 | psp_ring_destroy(psp, PSP_RING_TYPE__KM); |
1218 | 1223 | ||
1219 | amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, NULL); | 1224 | pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL; |
1225 | amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, pptr); | ||
1220 | amdgpu_bo_free_kernel(&psp->fw_pri_bo, | 1226 | amdgpu_bo_free_kernel(&psp->fw_pri_bo, |
1221 | &psp->fw_pri_mc_addr, &psp->fw_pri_buf); | 1227 | &psp->fw_pri_mc_addr, &psp->fw_pri_buf); |
1222 | amdgpu_bo_free_kernel(&psp->fence_buf_bo, | 1228 | amdgpu_bo_free_kernel(&psp->fence_buf_bo, |