diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2018-03-27 12:58:14 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-05-15 14:43:13 -0400 |
commit | 828536385ab0d25b5ddd7153347df04ea3a6961d (patch) | |
tree | 94745c42689a8b2a48bf012572eb4efae5094ad8 /drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | |
parent | 9da00630188da6e8ad1596c2b58809c833b16154 (diff) |
drm/amdgpu: add emit_reg_write_reg_wait ring callback
This callback writes a value to a register and then reads
back another register and waits for a value in a single
operation.
Provide a helper function using two operations for engines
that don't support this opertion.
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>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c index d5f526f38e50..49cad08b5c16 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | |||
@@ -459,6 +459,26 @@ void amdgpu_ring_lru_touch(struct amdgpu_device *adev, struct amdgpu_ring *ring) | |||
459 | spin_unlock(&adev->ring_lru_list_lock); | 459 | spin_unlock(&adev->ring_lru_list_lock); |
460 | } | 460 | } |
461 | 461 | ||
462 | /** | ||
463 | * amdgpu_ring_emit_reg_write_reg_wait_helper - ring helper | ||
464 | * | ||
465 | * @adev: amdgpu_device pointer | ||
466 | * @reg0: register to write | ||
467 | * @reg1: register to wait on | ||
468 | * @ref: reference value to write/wait on | ||
469 | * @mask: mask to wait on | ||
470 | * | ||
471 | * Helper for rings that don't support write and wait in a | ||
472 | * single oneshot packet. | ||
473 | */ | ||
474 | void amdgpu_ring_emit_reg_write_reg_wait_helper(struct amdgpu_ring *ring, | ||
475 | uint32_t reg0, uint32_t reg1, | ||
476 | uint32_t ref, uint32_t mask) | ||
477 | { | ||
478 | amdgpu_ring_emit_wreg(ring, reg0, ref); | ||
479 | amdgpu_ring_emit_reg_wait(ring, reg1, mask, mask); | ||
480 | } | ||
481 | |||
462 | /* | 482 | /* |
463 | * Debugfs info | 483 | * Debugfs info |
464 | */ | 484 | */ |