Set vm_manager.spm_vmid to the top GFXHUB VMID so the SPM reservation
path hands out a fixed, isolated VMID on gfx9 instead of borrowing one
from the graphics pool.

Signed-off-by: Sunil Khatri <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c 
b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
index 3a8dc15ef95b9..c058a00bf2fbb 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
@@ -2042,6 +2042,10 @@ static int gmc_v9_0_sw_init(struct amdgpu_ip_block 
*ip_block)
                        7;
 
        vmid_mask = GENMASK(last_kq_vmid, 1);
+
+       /* Reserve the last VMID for SPM */
+       adev->vm_manager.spm_vmid = AMDGPU_NUM_VMID - 1;
+
        amdgpu_vmid_mgr_set_vmid_mask(adev, vmid_mask, vmid_mask);
        amdgpu_vm_manager_init(adev);
 
-- 
2.34.1

Reply via email to