diff options
author | Shirish S <shirish.s@amd.com> | 2019-06-04 11:55:03 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-06-11 14:33:08 -0400 |
commit | 517b91f4cde3043d77b2178548473e8545ef07cb (patch) | |
tree | d58688db535ad4f4ad9552296de6d71be1f9245c /drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | |
parent | 671e2ee5ee2127179ca884b439ab6001a623edd6 (diff) |
drm/amdgpu/{uvd,vcn}: fetch ring's read_ptr after alloc
[What]
readptr read always returns zero, since most likely
these blocks are either power or clock gated.
[How]
fetch rptr after amdgpu_ring_alloc() which informs
the power management code that the block is about to be
used and hence the gating is turned off.
Signed-off-by: Louis Li <Ching-shih.Li@amd.com>
Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c index ecf6f96df2ad..e6b07ece3910 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | |||
@@ -594,7 +594,7 @@ error: | |||
594 | int amdgpu_vcn_enc_ring_test_ring(struct amdgpu_ring *ring) | 594 | int amdgpu_vcn_enc_ring_test_ring(struct amdgpu_ring *ring) |
595 | { | 595 | { |
596 | struct amdgpu_device *adev = ring->adev; | 596 | struct amdgpu_device *adev = ring->adev; |
597 | uint32_t rptr = amdgpu_ring_get_rptr(ring); | 597 | uint32_t rptr; |
598 | unsigned i; | 598 | unsigned i; |
599 | int r; | 599 | int r; |
600 | 600 | ||
@@ -602,6 +602,8 @@ int amdgpu_vcn_enc_ring_test_ring(struct amdgpu_ring *ring) | |||
602 | if (r) | 602 | if (r) |
603 | return r; | 603 | return r; |
604 | 604 | ||
605 | rptr = amdgpu_ring_get_rptr(ring); | ||
606 | |||
605 | amdgpu_ring_write(ring, VCN_ENC_CMD_END); | 607 | amdgpu_ring_write(ring, VCN_ENC_CMD_END); |
606 | amdgpu_ring_commit(ring); | 608 | amdgpu_ring_commit(ring); |
607 | 609 | ||