Skip to content

Commit 97a3d60

Browse files
Yifan Zhaalexdeucher
authored andcommitted
drm/amdgpu: Program GC registers through RLCG interface in gfx_v11/gmc_v11
[Why] L1 blocks most of GC registers accessing by MMIO. [How] Use RLCG interface to program GC registers under SRIOV VF in full access time. Signed-off-by: Yifan Zha <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent e688ba3 commit 97a3d60

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v11.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ static int init_interrupts_v11(struct amdgpu_device *adev, uint32_t pipe_id)
111111

112112
lock_srbm(adev, mec, pipe, 0, 0);
113113

114-
WREG32(SOC15_REG_OFFSET(GC, 0, regCPC_INT_CNTL),
114+
WREG32_SOC15(GC, 0, regCPC_INT_CNTL,
115115
CP_INT_CNTL_RING0__TIME_STAMP_INT_ENABLE_MASK |
116116
CP_INT_CNTL_RING0__OPCODE_ERROR_INT_ENABLE_MASK);
117117

drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1571,7 +1571,7 @@ static void gfx_v11_0_init_compute_vmid(struct amdgpu_device *adev)
15711571
WREG32_SOC15(GC, 0, regSH_MEM_BASES, sh_mem_bases);
15721572

15731573
/* Enable trap for each kfd vmid. */
1574-
data = RREG32(SOC15_REG_OFFSET(GC, 0, regSPI_GDBG_PER_VMID_CNTL));
1574+
data = RREG32_SOC15(GC, 0, regSPI_GDBG_PER_VMID_CNTL);
15751575
data = REG_SET_FIELD(data, SPI_GDBG_PER_VMID_CNTL, TRAP_EN, 1);
15761576
}
15771577
soc21_grbm_select(adev, 0, 0, 0, 0);

drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ static void gmc_v11_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,
186186
/* Use register 17 for GART */
187187
const unsigned eng = 17;
188188
unsigned int i;
189+
unsigned char hub_ip = 0;
190+
191+
hub_ip = (vmhub == AMDGPU_GFXHUB_0) ?
192+
GC_HWIP : MMHUB_HWIP;
189193

190194
spin_lock(&adev->gmc.invalidate_lock);
191195
/*
@@ -199,8 +203,8 @@ static void gmc_v11_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,
199203
if (use_semaphore) {
200204
for (i = 0; i < adev->usec_timeout; i++) {
201205
/* a read return value of 1 means semaphore acuqire */
202-
tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_sem +
203-
hub->eng_distance * eng);
206+
tmp = RREG32_RLC_NO_KIQ(hub->vm_inv_eng0_sem +
207+
hub->eng_distance * eng, hub_ip);
204208
if (tmp & 0x1)
205209
break;
206210
udelay(1);
@@ -210,12 +214,12 @@ static void gmc_v11_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,
210214
DRM_ERROR("Timeout waiting for sem acquire in VM flush!\n");
211215
}
212216

213-
WREG32_NO_KIQ(hub->vm_inv_eng0_req + hub->eng_distance * eng, inv_req);
217+
WREG32_RLC_NO_KIQ(hub->vm_inv_eng0_req + hub->eng_distance * eng, inv_req, hub_ip);
214218

215219
/* Wait for ACK with a delay.*/
216220
for (i = 0; i < adev->usec_timeout; i++) {
217-
tmp = RREG32_NO_KIQ(hub->vm_inv_eng0_ack +
218-
hub->eng_distance * eng);
221+
tmp = RREG32_RLC_NO_KIQ(hub->vm_inv_eng0_ack +
222+
hub->eng_distance * eng, hub_ip);
219223
tmp &= 1 << vmid;
220224
if (tmp)
221225
break;
@@ -229,8 +233,8 @@ static void gmc_v11_0_flush_vm_hub(struct amdgpu_device *adev, uint32_t vmid,
229233
* add semaphore release after invalidation,
230234
* write with 0 means semaphore release
231235
*/
232-
WREG32_NO_KIQ(hub->vm_inv_eng0_sem +
233-
hub->eng_distance * eng, 0);
236+
WREG32_RLC_NO_KIQ(hub->vm_inv_eng0_sem +
237+
hub->eng_distance * eng, 0, hub_ip);
234238

235239
/* Issue additional private vm invalidation to MMHUB */
236240
if ((vmhub != AMDGPU_GFXHUB_0) &&

0 commit comments

Comments
 (0)