[PATCH] drm/amdgpu: fix vcn_v1_0_dec_ring_emit_wreg

Deucher, Alexander Alexander.Deucher at amd.com
Fri Jan 26 21:28:11 UTC 2018


Reviewed-by: Alex Deucher <alexander.deucher at amd.com>


________________________________
From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken at gmail.com>
Sent: Friday, January 26, 2018 8:24 AM
To: amd-gfx at lists.freedesktop.org
Subject: [PATCH] drm/amdgpu: fix vcn_v1_0_dec_ring_emit_wreg

That got mixed up with the encode ring function.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
index 44c041a1fe68..24ebc3e296a6 100644
--- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
@@ -880,6 +880,22 @@ static void vcn_v1_0_dec_ring_emit_vm_flush(struct amdgpu_ring *ring,
         vcn_v1_0_dec_vm_reg_wait(ring, data0, data1, mask);
 }

+static void vcn_v1_0_dec_ring_emit_wreg(struct amdgpu_ring *ring,
+                                       uint32_t reg, uint32_t val)
+{
+       struct amdgpu_device *adev = ring->adev;
+
+       amdgpu_ring_write(ring,
+               PACKET0(SOC15_REG_OFFSET(UVD, 0, mmUVD_GPCOM_VCPU_DATA0), 0));
+       amdgpu_ring_write(ring, reg << 2);
+       amdgpu_ring_write(ring,
+               PACKET0(SOC15_REG_OFFSET(UVD, 0, mmUVD_GPCOM_VCPU_DATA1), 0));
+       amdgpu_ring_write(ring, val);
+       amdgpu_ring_write(ring,
+               PACKET0(SOC15_REG_OFFSET(UVD, 0, mmUVD_GPCOM_VCPU_CMD), 0));
+       amdgpu_ring_write(ring, VCN_DEC_CMD_WRITE_REG << 1);
+}
+
 /**
  * vcn_v1_0_enc_ring_get_rptr - get enc read pointer
  *
@@ -1097,7 +1113,7 @@ static const struct amdgpu_ring_funcs vcn_v1_0_dec_ring_vm_funcs = {
         .pad_ib = amdgpu_ring_generic_pad_ib,
         .begin_use = amdgpu_vcn_ring_begin_use,
         .end_use = amdgpu_vcn_ring_end_use,
-       .emit_wreg = vcn_v1_0_enc_ring_emit_wreg,
+       .emit_wreg = vcn_v1_0_dec_ring_emit_wreg,
 };

 static const struct amdgpu_ring_funcs vcn_v1_0_enc_ring_vm_funcs = {
@@ -1124,6 +1140,7 @@ static const struct amdgpu_ring_funcs vcn_v1_0_enc_ring_vm_funcs = {
         .pad_ib = amdgpu_ring_generic_pad_ib,
         .begin_use = amdgpu_vcn_ring_begin_use,
         .end_use = amdgpu_vcn_ring_end_use,
+       .emit_wreg = vcn_v1_0_enc_ring_emit_wreg,
 };

 static void vcn_v1_0_set_dec_ring_funcs(struct amdgpu_device *adev)
--
2.14.1

_______________________________________________
amd-gfx mailing list
amd-gfx at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20180126/38bb86dd/attachment.html>


More information about the amd-gfx mailing list