drm/amdgpu/psp: move TMR to cpu invisible vram region
authorTianci.Yin <tianci.yin@amd.com>
Mon, 19 Aug 2019 07:30:22 +0000 (15:30 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 22 Aug 2019 03:16:45 +0000 (22:16 -0500)
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>
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h

index 2d07f16f178971f43c13736b64309e3d87a163d8..008bf62044b09a64b40f6a7d935008b89cc7ab1c 100644 (file)
@@ -246,8 +246,9 @@ int amdgpu_bo_create_reserved(struct amdgpu_device *adev,
        bp.size = size;
        bp.byte_align = align;
        bp.domain = domain;
-       bp.flags = AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED |
-               AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS;
+       bp.flags = cpu_addr ? AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED
+               : AMDGPU_GEM_CREATE_NO_CPU_ACCESS;
+       bp.flags |= AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS;
        bp.type = ttm_bo_type_kernel;
        bp.resv = NULL;
 
index 29cac5525767dd5fc73143293a5816eed0c9c220..f06f5ef0ca4bbd5d6008608fe380cca621dbeb8b 100644 (file)
@@ -263,7 +263,7 @@ static int psp_tmr_init(struct psp_context *psp)
 
        ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE,
                                      AMDGPU_GEM_DOMAIN_VRAM,
-                                     &psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);
+                                     &psp->tmr_bo, &psp->tmr_mc_addr, NULL);
 
        return ret;
 }
@@ -1216,7 +1216,7 @@ static int psp_hw_fini(void *handle)
 
        psp_ring_destroy(psp, PSP_RING_TYPE__KM);
 
-       amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf);
+       amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, NULL);
        amdgpu_bo_free_kernel(&psp->fw_pri_bo,
                              &psp->fw_pri_mc_addr, &psp->fw_pri_buf);
        amdgpu_bo_free_kernel(&psp->fence_buf_bo,
index b73d4aa28fbaf47c3d7f751a4e0497f85662284b..bc0947f6bc8a929226e64303bfe8be6cd434be9a 100644 (file)
@@ -171,7 +171,6 @@ struct psp_context
        /* tmr buffer */
        struct amdgpu_bo                *tmr_bo;
        uint64_t                        tmr_mc_addr;
-       void                            *tmr_buf;
 
        /* asd firmware and buffer */
        const struct firmware           *asd_fw;