diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-09-16 15:27:55 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2019-09-16 15:27:55 +0000 |
commit | 6722bcdb5c7e107ab5ae05fa7e1088de3a40136e (patch) | |
tree | ebc949468d8c4708b2021949f3e040c862233881 /sys/dev/pci/drm | |
parent | bfed88b2d69c25521b82d2692fca2a4c22bf680b (diff) |
drm/amdgpu/{uvd,vcn}: fetch ring's read_ptr after alloc
From Shirish S
f276beb324cc1c60dc3495dc03a927a70c1aa5c7 in linux 4.19.y/4.19.73
517b91f4cde3043d77b2178548473e8545ef07cb in mainline linux
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/amdgpu_vcn.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/uvd_v6_0.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/drm/amd/amdgpu/uvd_v7_0.c | 5 |
3 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_vcn.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_vcn.c index 44a9140f1c4..fae2dbfa289 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_vcn.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_vcn.c @@ -436,7 +436,7 @@ error: int amdgpu_vcn_enc_ring_test_ring(struct amdgpu_ring *ring) { struct amdgpu_device *adev = ring->adev; - uint32_t rptr = amdgpu_ring_get_rptr(ring); + uint32_t rptr; unsigned i; int r; @@ -446,6 +446,9 @@ int amdgpu_vcn_enc_ring_test_ring(struct amdgpu_ring *ring) ring->idx, r); return r; } + + rptr = amdgpu_ring_get_rptr(ring); + amdgpu_ring_write(ring, VCN_ENC_CMD_END); amdgpu_ring_commit(ring); diff --git a/sys/dev/pci/drm/amd/amdgpu/uvd_v6_0.c b/sys/dev/pci/drm/amd/amdgpu/uvd_v6_0.c index b82d065e130..457591784de 100644 --- a/sys/dev/pci/drm/amd/amdgpu/uvd_v6_0.c +++ b/sys/dev/pci/drm/amd/amdgpu/uvd_v6_0.c @@ -170,7 +170,7 @@ static void uvd_v6_0_enc_ring_set_wptr(struct amdgpu_ring *ring) static int uvd_v6_0_enc_ring_test_ring(struct amdgpu_ring *ring) { struct amdgpu_device *adev = ring->adev; - uint32_t rptr = amdgpu_ring_get_rptr(ring); + uint32_t rptr; unsigned i; int r; @@ -180,6 +180,9 @@ static int uvd_v6_0_enc_ring_test_ring(struct amdgpu_ring *ring) ring->idx, r); return r; } + + rptr = amdgpu_ring_get_rptr(ring); + amdgpu_ring_write(ring, HEVC_ENC_CMD_END); amdgpu_ring_commit(ring); diff --git a/sys/dev/pci/drm/amd/amdgpu/uvd_v7_0.c b/sys/dev/pci/drm/amd/amdgpu/uvd_v7_0.c index 2b2f70f8346..d479c5c1933 100644 --- a/sys/dev/pci/drm/amd/amdgpu/uvd_v7_0.c +++ b/sys/dev/pci/drm/amd/amdgpu/uvd_v7_0.c @@ -175,7 +175,7 @@ static void uvd_v7_0_enc_ring_set_wptr(struct amdgpu_ring *ring) static int uvd_v7_0_enc_ring_test_ring(struct amdgpu_ring *ring) { struct amdgpu_device *adev = ring->adev; - uint32_t rptr = amdgpu_ring_get_rptr(ring); + uint32_t rptr; unsigned i; int r; @@ -188,6 +188,9 @@ static int uvd_v7_0_enc_ring_test_ring(struct amdgpu_ring *ring) ring->me, ring->idx, r); return r; } + + rptr = amdgpu_ring_get_rptr(ring); + amdgpu_ring_write(ring, HEVC_ENC_CMD_END); amdgpu_ring_commit(ring); |