diff options
| author | Jack Xiao <[email protected]> | 2020-03-22 05:31:52 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2022-05-04 14:43:49 +0000 |
| commit | 065891958d8c9bd96d1adbadc3c1251a14cf14fc (patch) | |
| tree | 5c391446f5a3c7df9352dedf0f83fc7908eabd73 /drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | |
| parent | drm/amdgpu: don't use kiq to flush gpu tlb if mes enabled (diff) | |
| download | kernel-065891958d8c9bd96d1adbadc3c1251a14cf14fc.tar.gz kernel-065891958d8c9bd96d1adbadc3c1251a14cf14fc.zip | |
drm/amdgpu/sdma: use per-ctx sdma csa address for mes sdma queue
Use per context sdma csa address for mes sdma queue.
Signed-off-by: Jack Xiao <[email protected]>
Acked-by: Christian König <[email protected]>
Reviewed-by: Hawking Zhang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c index e1835fd4b237..8e221a1ba937 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c @@ -74,14 +74,22 @@ uint64_t amdgpu_sdma_get_csa_mc_addr(struct amdgpu_ring *ring, if (amdgpu_sriov_vf(adev) || vmid == 0 || !amdgpu_mcbp) return 0; - r = amdgpu_sdma_get_index_from_ring(ring, &index); + if (ring->is_mes_queue) { + uint32_t offset = 0; - if (r || index > 31) - csa_mc_addr = 0; - else - csa_mc_addr = amdgpu_csa_vaddr(adev) + - AMDGPU_CSA_SDMA_OFFSET + - index * AMDGPU_CSA_SDMA_SIZE; + offset = offsetof(struct amdgpu_mes_ctx_meta_data, + sdma[ring->idx].sdma_meta_data); + csa_mc_addr = amdgpu_mes_ctx_get_offs_gpu_addr(ring, offset); + } else { + r = amdgpu_sdma_get_index_from_ring(ring, &index); + + if (r || index > 31) + csa_mc_addr = 0; + else + csa_mc_addr = amdgpu_csa_vaddr(adev) + + AMDGPU_CSA_SDMA_OFFSET + + index * AMDGPU_CSA_SDMA_SIZE; + } return csa_mc_addr; } |
