aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianci.Yin <tianci.yin@amd.com>2019-08-19 03:30:22 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-08-21 23:16:45 -0400
commit828d6fde7f574d74b0a6a591345d3c42b62d5e21 (patch)
tree7ce30e6a5b116a126dd99d76ed182549a35cc08d
parent50e275e88044c8dfb952606a01b284dfe3ad36ab (diff)
drm/amdgpu/psp: move TMR to cpu invisible vram region
so that more visible vram can be available for umd. 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_object.c5
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c4
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h1
3 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
index 2d07f16f1789..008bf62044b0 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
@@ -246,8 +246,9 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
246 bp.size = size; 246 bp.size = size;
247 bp.byte_align = align; 247 bp.byte_align = align;
248 bp.domain = domain; 248 bp.domain = domain;
249 bp.flags = AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED | 249 bp.flags = cpu_addr ? AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED
250 AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS; 250 : AMDGPU_GEM_CREATE_NO_CPU_ACCESS;
251 bp.flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS;
251 bp.type = ttm_bo_type_kernel; 252 bp.type = ttm_bo_type_kernel;
252 bp.resv = NULL; 253 bp.resv = NULL;
253 254
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 29cac5525767..f06f5ef0ca4b 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -263,7 +263,7 @@ static int psp_tmr_init(struct psp_context *psp)
263 263
264 ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE, 264 ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE,
265 AMDGPU_GEM_DOMAIN_VRAM, 265 AMDGPU_GEM_DOMAIN_VRAM,
266 &psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf); 266 &psp->tmr_bo, &psp->tmr_mc_addr, NULL);
267 267
268 return ret; 268 return ret;
269} 269}
@@ -1216,7 +1216,7 @@ static int psp_hw_fini(void *handle)
1216 1216
1217 psp_ring_destroy(psp, PSP_RING_TYPE__KM); 1217 psp_ring_destroy(psp, PSP_RING_TYPE__KM);
1218 1218
1219 amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf); 1219 amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, NULL);
1220 amdgpu_bo_free_kernel(&psp->fw_pri_bo, 1220 amdgpu_bo_free_kernel(&psp->fw_pri_bo,
1221 &psp->fw_pri_mc_addr, &psp->fw_pri_buf); 1221 &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
1222 amdgpu_bo_free_kernel(&psp->fence_buf_bo, 1222 amdgpu_bo_free_kernel(&psp->fence_buf_bo,
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
index b73d4aa28fba..bc0947f6bc8a 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
@@ -171,7 +171,6 @@ struct psp_context
171 /* tmr buffer */ 171 /* tmr buffer */
172 struct amdgpu_bo *tmr_bo; 172 struct amdgpu_bo *tmr_bo;
173 uint64_t tmr_mc_addr; 173 uint64_t tmr_mc_addr;
174 void *tmr_buf;
175 174
176 /* asd firmware and buffer */ 175 /* asd firmware and buffer */
177 const struct firmware *asd_fw; 176 const struct firmware *asd_fw;