aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2018-03-27 16:07:50 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-05-15 14:43:13 -0400
commit10ed3c3190d38f189ed6857cecca1a2eb6de33a3 (patch)
tree8403b4414ac9b6fdd7cd46bd3adc5b9ed3a1ef67 /drivers/gpu/drm/amd/amdgpu
parent828536385ab0d25b5ddd7153347df04ea3a6961d (diff)
drm/amdgpu/gfx9: add emit_reg_write_reg_wait ring callback (v2)
This adds support for writing and reading back in a single oneshot packet. This is needed to send a tlb invalidation and wait for ack in a single operation. v2: squash the gfx ring stall fix Reviewed-by: Huang Rui <ray.huang@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Emily Deng <Emily.Deng@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
index 66bd6c1c82c0..583f6f616dd3 100644
--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
@@ -4138,6 +4138,15 @@ static void gfx_v9_0_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg,
4138 gfx_v9_0_wait_reg_mem(ring, 0, 0, 0, reg, 0, val, mask, 0x20); 4138 gfx_v9_0_wait_reg_mem(ring, 0, 0, 0, reg, 0, val, mask, 0x20);
4139} 4139}
4140 4140
4141static void gfx_v9_0_ring_emit_reg_write_reg_wait(struct amdgpu_ring *ring,
4142 uint32_t reg0, uint32_t reg1,
4143 uint32_t ref, uint32_t mask)
4144{
4145 int usepfp = (ring->funcs->type == AMDGPU_RING_TYPE_GFX);
4146
4147 gfx_v9_0_wait_reg_mem(ring, usepfp, 0, 1, reg0, reg1, ref, mask, 0x20);
4148}
4149
4141static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev, 4150static void gfx_v9_0_set_gfx_eop_interrupt_state(struct amdgpu_device *adev,
4142 enum amdgpu_interrupt_state state) 4151 enum amdgpu_interrupt_state state)
4143{ 4152{
@@ -4459,6 +4468,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_gfx = {
4459 .emit_tmz = gfx_v9_0_ring_emit_tmz, 4468 .emit_tmz = gfx_v9_0_ring_emit_tmz,
4460 .emit_wreg = gfx_v9_0_ring_emit_wreg, 4469 .emit_wreg = gfx_v9_0_ring_emit_wreg,
4461 .emit_reg_wait = gfx_v9_0_ring_emit_reg_wait, 4470 .emit_reg_wait = gfx_v9_0_ring_emit_reg_wait,
4471 .emit_reg_write_reg_wait = gfx_v9_0_ring_emit_reg_write_reg_wait,
4462}; 4472};
4463 4473
4464static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = { 4474static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
@@ -4493,6 +4503,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_compute = {
4493 .set_priority = gfx_v9_0_ring_set_priority_compute, 4503 .set_priority = gfx_v9_0_ring_set_priority_compute,
4494 .emit_wreg = gfx_v9_0_ring_emit_wreg, 4504 .emit_wreg = gfx_v9_0_ring_emit_wreg,
4495 .emit_reg_wait = gfx_v9_0_ring_emit_reg_wait, 4505 .emit_reg_wait = gfx_v9_0_ring_emit_reg_wait,
4506 .emit_reg_write_reg_wait = gfx_v9_0_ring_emit_reg_write_reg_wait,
4496}; 4507};
4497 4508
4498static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = { 4509static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = {
@@ -4523,6 +4534,7 @@ static const struct amdgpu_ring_funcs gfx_v9_0_ring_funcs_kiq = {
4523 .emit_rreg = gfx_v9_0_ring_emit_rreg, 4534 .emit_rreg = gfx_v9_0_ring_emit_rreg,
4524 .emit_wreg = gfx_v9_0_ring_emit_wreg, 4535 .emit_wreg = gfx_v9_0_ring_emit_wreg,
4525 .emit_reg_wait = gfx_v9_0_ring_emit_reg_wait, 4536 .emit_reg_wait = gfx_v9_0_ring_emit_reg_wait,
4537 .emit_reg_write_reg_wait = gfx_v9_0_ring_emit_reg_write_reg_wait,
4526}; 4538};
4527 4539
4528static void gfx_v9_0_set_ring_funcs(struct amdgpu_device *adev) 4540static void gfx_v9_0_set_ring_funcs(struct amdgpu_device *adev)