Skip to contentSkip to conversation

drm/amdgpu: change the alignment size of TMR BO to 1M

PATCH Superseded Yang Wang 2 participants 2 messages Sep 9, 2022

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Yang Wang

author
#0 lore raw

PATCH 1/1 drm/amdgpu: change the alignment size of TMR BO to 1M

align TMR BO size TO tmr size is not necessary,
modify the size to 1M to avoid re-create BO fail
when serious VRAM fragmentation.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -1
index cfcaf890a6a1..5585cda8d24b 100644
@@ -766,7 +766,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(psp->adev),
+	ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, SZ_1M,
 				      AMDGPU_GEM_DOMAIN_VRAM,
 				      &psp->tmr_bo, &psp->tmr_mc_addr, pptr);
 
Signature · 1 line
2.25.1
#1 lore raw

[AMD Official Use Only - General]

Let’s create a new macro PSP_TMR_ALIGNMENT in case we need to support ASIC specific TMR alignment in future.

Regards,
Hawking
From: Wang, Yang(Kevin) <[email protected]>
Date: Friday, September 9, 2022 at 11:14
To: [email protected] <[email protected]>
Cc: Zhang, Hawking <[email protected]>, Wang, Yang(Kevin) <[email protected]>
Subject: [PATCH] drm/amdgpu: change the alignment size of TMR BO to 1M align TMR BO size TO tmr size is not necessary,
modify the size to 1M to avoid re-create BO fail
when serious VRAM fragmentation.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -1
index cfcaf890a6a1..5585cda8d24b 100644
@@ -766,7 +766,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(psp->adev),
+       ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, SZ_1M,
                                       AMDGPU_GEM_DOMAIN_VRAM,
                                       &psp->tmr_bo, &psp->tmr_mc_addr, pptr);
 

--
2.25.1