drm/amdgpu: Increase PSP runtime TMR region size
authorOak Zeng <Oak.Zeng@amd.com>
Mon, 1 Mar 2021 23:36:19 +0000 (17:36 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 Mar 2021 03:00:51 +0000 (23:00 -0400)
Aldebaran uses more than 4M runtime TMR. The current
hard coded 4M TMR is not big enough for Aldebaran.
Increase it to 8M.

v2: Only do 8M size for ALDEBARAN (Hawking)

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h

index 6916292..d9856ca 100644 (file)
@@ -387,7 +387,7 @@ static int psp_tmr_init(struct psp_context *psp)
         * Note: this memory need be reserved till the driver
         * uninitializes.
         */
-       tmr_size = PSP_TMR_SIZE;
+       tmr_size = PSP_TMR_SIZE(psp->adev);
 
        /* For ASICs support RLC autoload, psp will parse the toc
         * and calculate the total size of TMR needed */
@@ -403,7 +403,7 @@ static int psp_tmr_init(struct psp_context *psp)
        }
 
        pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL;
-       ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE,
+       ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_SIZE(psp->adev),
                                      AMDGPU_GEM_DOMAIN_VRAM,
                                      &psp->tmr_bo, &psp->tmr_mc_addr, pptr);
 
index 9c9a13f..64f1433 100644 (file)
@@ -37,7 +37,7 @@
 #define PSP_XGMI_SHARED_MEM_SIZE 0x4000
 #define PSP_RAS_SHARED_MEM_SIZE 0x4000
 #define PSP_1_MEG              0x100000
-#define PSP_TMR_SIZE   0x400000
+#define PSP_TMR_SIZE(adev)     ((adev)->asic_type == CHIP_ALDEBARAN ? 0x800000 : 0x400000)
 #define PSP_HDCP_SHARED_MEM_SIZE       0x4000
 #define PSP_DTM_SHARED_MEM_SIZE        0x4000
 #define PSP_RAP_SHARED_MEM_SIZE        0x4000