Skip to contentSkip to conversation

drm/amdgpu: enable trap of each kfd vmid for gfx v9.4.3

PATCH In review Eric Huang 2 participants 2 messages Jul 25, 2023

Subsystems (2)
lore
Share & tools
lore

Eric Huang

author
#0 lore raw

PATCH 1/1 drm/amdgpu: enable trap of each kfd vmid for gfx v9.4.3

To setup ttmp on as default for gfx v9.4.3 in IP hw init.

---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +6 -0
index 86a84a0970f0..9a90fd187909 100644
@@ -898,6 +898,7 @@ static void gfx_v9_4_3_xcc_init_compute_vmid(struct amdgpu_device *adev,
 	int i;
 	uint32_t sh_mem_config;
 	uint32_t sh_mem_bases;
+	uint32_t data;
 
 	/*
 	 * Configure apertures:
@@ -917,6 +918,11 @@ static void gfx_v9_4_3_xcc_init_compute_vmid(struct amdgpu_device *adev,
 		/* CP and shaders */
 		WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id), regSH_MEM_CONFIG, sh_mem_config);
 		WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id), regSH_MEM_BASES, sh_mem_bases);
+
+		/* Enable trap for each kfd vmid. */
+		data = RREG32_SOC15(GC, GET_INST(GC, xcc_id), regSPI_GDBG_PER_VMID_CNTL);
+		data = REG_SET_FIELD(data, SPI_GDBG_PER_VMID_CNTL, TRAP_EN, 1);
+		WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id), regSPI_GDBG_PER_VMID_CNTL, data);
 	}
 	soc15_grbm_select(adev, 0, 0, 0, 0, GET_INST(GC, xcc_id));
 	mutex_unlock(&adev->srbm_mutex);
Signature · 1 line
2.34.1
Reviewed-by on v1 1/1
#1 lore raw

[Public]

Quoted 11 lines

-----Original Message-----
From: Huang, JinHuiEric <[email protected]>
Sent: Tuesday, July 25, 2023 2:16 PM
To: [email protected]
Cc: Kim, Jonathan <[email protected]>; Huang, JinHuiEric <[email protected]>
Subject: [PATCH] drm/amdgpu: enable trap of each kfd vmid for gfx v9.4.3

To setup ttmp on as default for gfx v9.4.3 in IP hw init.

Quoted 38 lines
---
 drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +1 -0
index 86a84a0970f0..9a90fd187909 100644
@@ -898,6 +898,7 @@ static void gfx_v9_4_3_xcc_init_compute_vmid(struct
 amdgpu_device *adev,
      int i;
      uint32_t sh_mem_config;
      uint32_t sh_mem_bases;
+     uint32_t data;
 
      /*

* Configure apertures:

drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c +3 -0
@@ -917,6 +918,11 @@ static void
 gfx_v9_4_3_xcc_init_compute_vmid(struct amdgpu_device *adev,
              /* CP and shaders */
              WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id),
 regSH_MEM_CONFIG, sh_mem_config);
              WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id),
 regSH_MEM_BASES, sh_mem_bases);
+
+             /* Enable trap for each kfd vmid. */
+             data = RREG32_SOC15(GC, GET_INST(GC, xcc_id),

regSPI_GDBG_PER_VMID_CNTL);
+ data = REG_SET_FIELD(data, SPI_GDBG_PER_VMID_CNTL,
TRAP_EN, 1);
+ WREG32_SOC15_RLC(GC, GET_INST(GC, xcc_id),

regSPI_GDBG_PER_VMID_CNTL, data);
      }
      soc15_grbm_select(adev, 0, 0, 0, 0, GET_INST(GC, xcc_id));
      mutex_unlock(&adev->srbm_mutex);

--
2.34.1