Skip to contentSkip to conversation

drm/amdgpu: fix insert nop for VCN decode ring

PATCH In review Leo Liu 3 participants 9 messages May 17, 2018 – May 18, 2018 4 messages not in the archive

Subsystems (2)
lore
Share & tools
lore

Leo Liu

author
#0 lore raw

PATCH 1/5 drm/amdgpu: fix insert nop for VCN decode ring

NO_OP register should be writen to 0

---
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +8 -6
index 0501746b..7fbbdb1 100644
@@ -1048,14 +1048,17 @@ static int vcn_v1_0_process_interrupt(struct amdgpu_device *adev,
 	return 0;
 }
 
-static void vcn_v1_0_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
+static void vcn_v1_0_dec_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
 {
-	int i;
 	struct amdgpu_device *adev = ring->adev;
+	int i;
 
-	for (i = 0; i < count; i++)
-		amdgpu_ring_write(ring, PACKET0(SOC15_REG_OFFSET(UVD, 0, mmUVD_NO_OP), 0));
+	WARN_ON(ring->wptr % 2 || count % 2);
 
+	for (i = 0; i < count / 2; i++) {
+		amdgpu_ring_write(ring, PACKET0(SOC15_REG_OFFSET(UVD, 0, mmUVD_NO_OP), 0));
+		amdgpu_ring_write(ring, 0);
+	}
 }
 
 
@@ -1082,7 +1085,6 @@ static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {
 static const struct amdgpu_ring_funcs vcn_v1_0_dec_ring_vm_funcs = {
 	.type = AMDGPU_RING_TYPE_VCN_DEC,
 	.align_mask = 0xf,
-	.nop = PACKET0(0x81ff, 0),
 	.support_64bit_ptrs = false,
 	.vmhub = AMDGPU_MMHUB,
 	.get_rptr = vcn_v1_0_dec_ring_get_rptr,
@@ -1101,7 +1103,7 @@ static const struct amdgpu_ring_funcs vcn_v1_0_dec_ring_vm_funcs = {
 	.emit_vm_flush = vcn_v1_0_dec_ring_emit_vm_flush,
 	.test_ring = amdgpu_vcn_dec_ring_test_ring,
 	.test_ib = amdgpu_vcn_dec_ring_test_ib,
-	.insert_nop = vcn_v1_0_ring_insert_nop,
+	.insert_nop = vcn_v1_0_dec_ring_insert_nop,
 	.insert_start = vcn_v1_0_dec_ring_insert_start,
 	.insert_end = vcn_v1_0_dec_ring_insert_end,
 	.pad_ib = amdgpu_ring_generic_pad_ib,
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#2 lore raw

PATCH 2/5 drm/amdgpu: fix insert nop for UVD7 ring

NO_OP register should be writen to 0

---
 drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c +6 -4
index f9a54821..57d32f2 100644
@@ -1325,12 +1325,15 @@ static void uvd_v7_0_ring_emit_vm_flush(struct amdgpu_ring *ring,
 
 static void uvd_v7_0_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
 {
-	int i;
 	struct amdgpu_device *adev = ring->adev;
+	int i;
 
-	for (i = 0; i < count; i++)
-		amdgpu_ring_write(ring, PACKET0(SOC15_REG_OFFSET(UVD, ring->me, mmUVD_NO_OP), 0));
+	WARN_ON(ring->wptr % 2 || count % 2);
 
+	for (i = 0; i < count / 2; i++) {
+		amdgpu_ring_write(ring, PACKET0(SOC15_REG_OFFSET(UVD, ring->me, mmUVD_NO_OP), 0));
+		amdgpu_ring_write(ring, 0);
+	}
 }
 
 static void uvd_v7_0_enc_ring_insert_end(struct amdgpu_ring *ring)
@@ -1710,7 +1713,6 @@ const struct amd_ip_funcs uvd_v7_0_ip_funcs = {
 static const struct amdgpu_ring_funcs uvd_v7_0_ring_vm_funcs = {
 	.type = AMDGPU_RING_TYPE_UVD,
 	.align_mask = 0xf,
-	.nop = PACKET0(0x81ff, 0),
 	.support_64bit_ptrs = false,
 	.vmhub = AMDGPU_MMHUB,
 	.get_rptr = uvd_v7_0_ring_get_rptr,
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#3 lore raw

PATCH 3/5 drm/amdgpu: fix insert nop for UVD6 ring

In reply to a message not in the archive

NO_OP register should be writen to 0

---
 drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +13 -2
index dc39169..bfddf97 100644
@@ -1100,6 +1100,18 @@ static void uvd_v6_0_ring_emit_pipeline_sync(struct amdgpu_ring *ring)
 	amdgpu_ring_write(ring, 0xE);
 }
 
+static void uvd_v6_0_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
+{
+	int i;
+
+	WARN_ON(ring->wptr % 2 || count % 2);
+
+	for (i = 0; i < count / 2; i++) {
+		amdgpu_ring_write(ring, PACKET0(mmUVD_NO_OP, 0));
+		amdgpu_ring_write(ring, 0);
+	}
+}
+
 static void uvd_v6_0_enc_ring_emit_pipeline_sync(struct amdgpu_ring *ring)
 {
 	uint32_t seq = ring->fence_drv.sync_seq;
@@ -1532,7 +1544,6 @@ static const struct amd_ip_funcs uvd_v6_0_ip_funcs = {
 static const struct amdgpu_ring_funcs uvd_v6_0_ring_phys_funcs = {
 	.type = AMDGPU_RING_TYPE_UVD,
 	.align_mask = 0xf,
-	.nop = PACKET0(mmUVD_NO_OP, 0),
 	.support_64bit_ptrs = false,
 	.get_rptr = uvd_v6_0_ring_get_rptr,
 	.get_wptr = uvd_v6_0_ring_get_wptr,
@@ -1548,7 +1559,7 @@ static const struct amdgpu_ring_funcs uvd_v6_0_ring_phys_funcs = {
 	.emit_hdp_flush = uvd_v6_0_ring_emit_hdp_flush,
 	.test_ring = uvd_v6_0_ring_test_ring,
 	.test_ib = amdgpu_uvd_ring_test_ib,
-	.insert_nop = amdgpu_ring_insert_nop,
+	.insert_nop = uvd_v6_0_ring_insert_nop,
 	.pad_ib = amdgpu_ring_generic_pad_ib,
 	.begin_use = amdgpu_uvd_ring_begin_use,
 	.end_use = amdgpu_uvd_ring_end_use,
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#4 lore raw

PATCH 4/5 drm/amdgpu: fix insert nop for UVD5 ring

In reply to a message not in the archive

NO_OP register should be writen to 0

---
 drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/uvd_v5_0.c +13 -2
index f5d074a..341ee6d 100644
@@ -541,6 +541,18 @@ static void uvd_v5_0_ring_emit_ib(struct amdgpu_ring *ring,
 	amdgpu_ring_write(ring, ib->length_dw);
 }
 
+static void uvd_v5_0_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
+{
+	int i;
+
+	WARN_ON(ring->wptr % 2 || count % 2);
+
+	for (i = 0; i < count / 2; i++) {
+		amdgpu_ring_write(ring, PACKET0(mmUVD_NO_OP, 0));
+		amdgpu_ring_write(ring, 0);
+	}
+}
+
 static bool uvd_v5_0_is_idle(void *handle)
 {
 	struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -841,7 +853,6 @@ static const struct amd_ip_funcs uvd_v5_0_ip_funcs = {
 static const struct amdgpu_ring_funcs uvd_v5_0_ring_funcs = {
 	.type = AMDGPU_RING_TYPE_UVD,
 	.align_mask = 0xf,
-	.nop = PACKET0(mmUVD_NO_OP, 0),
 	.support_64bit_ptrs = false,
 	.get_rptr = uvd_v5_0_ring_get_rptr,
 	.get_wptr = uvd_v5_0_ring_get_wptr,
@@ -854,7 +865,7 @@ static const struct amdgpu_ring_funcs uvd_v5_0_ring_funcs = {
 	.emit_fence = uvd_v5_0_ring_emit_fence,
 	.test_ring = uvd_v5_0_ring_test_ring,
 	.test_ib = amdgpu_uvd_ring_test_ib,
-	.insert_nop = amdgpu_ring_insert_nop,
+	.insert_nop = uvd_v5_0_ring_insert_nop,
 	.pad_ib = amdgpu_ring_generic_pad_ib,
 	.begin_use = amdgpu_uvd_ring_begin_use,
 	.end_use = amdgpu_uvd_ring_end_use,
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author
#5 lore raw

PATCH 5/5 drm/amdgpu: fix insert nop for UVD4.2 ring

In reply to a message not in the archive

NO_OP register should be writen to 0

---
 drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/uvd_v4_2.c +13 -2
index 5f22135d..6fed3d7 100644
@@ -524,6 +524,18 @@ static void uvd_v4_2_ring_emit_ib(struct amdgpu_ring *ring,
 	amdgpu_ring_write(ring, ib->length_dw);
 }
 
+static void uvd_v4_2_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
+{
+	int i;
+
+	WARN_ON(ring->wptr % 2 || count % 2);
+
+	for (i = 0; i < count / 2; i++) {
+		amdgpu_ring_write(ring, PACKET0(mmUVD_NO_OP, 0));
+		amdgpu_ring_write(ring, 0);
+	}
+}
+
 /**
  * uvd_v4_2_mc_resume - memory controller programming
  *
@@ -733,7 +745,6 @@ static const struct amd_ip_funcs uvd_v4_2_ip_funcs = {
 static const struct amdgpu_ring_funcs uvd_v4_2_ring_funcs = {
 	.type = AMDGPU_RING_TYPE_UVD,
 	.align_mask = 0xf,
-	.nop = PACKET0(mmUVD_NO_OP, 0),
 	.support_64bit_ptrs = false,
 	.get_rptr = uvd_v4_2_ring_get_rptr,
 	.get_wptr = uvd_v4_2_ring_get_wptr,
@@ -746,7 +757,7 @@ static const struct amdgpu_ring_funcs uvd_v4_2_ring_funcs = {
 	.emit_fence = uvd_v4_2_ring_emit_fence,
 	.test_ring = uvd_v4_2_ring_test_ring,
 	.test_ib = amdgpu_uvd_ring_test_ib,
-	.insert_nop = amdgpu_ring_insert_nop,
+	.insert_nop = uvd_v4_2_ring_insert_nop,
 	.pad_ib = amdgpu_ring_generic_pad_ib,
 	.begin_use = amdgpu_uvd_ring_begin_use,
 	.end_use = amdgpu_uvd_ring_end_use,
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#6 lore raw
In reply to a message not in the archive
Quoted 3 lines · Leo Liu

NO_OP register should be writen to 0

We discussed this when we first started working on amdgpu. Does it have to be 0? This function is used for padding. What happens if we need an odd number of dwords of padding required?

Alex

Quoted 50 lines
---
 drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +8 -7
index 0501746b..7fbbdb1 100644
@@ -1048,14 +1048,17 @@ static int vcn_v1_0_process_interrupt(struct amdgpu_device *adev,
        return 0;
 }
 
-static void vcn_v1_0_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
+static void vcn_v1_0_dec_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
 {
-       int i;
        struct amdgpu_device *adev = ring->adev;
+       int i;
 
-       for (i = 0; i < count; i++)
-               amdgpu_ring_write(ring, PACKET0(SOC15_REG_OFFSET(UVD, 0, mmUVD_NO_OP), 0));
+       WARN_ON(ring->wptr % 2 || count % 2);
 
+       for (i = 0; i < count / 2; i++) {
+               amdgpu_ring_write(ring, PACKET0(SOC15_REG_OFFSET(UVD, 0, mmUVD_NO_OP), 0));
+               amdgpu_ring_write(ring, 0);
+       }
 }
 
 
@@ -1082,7 +1085,6 @@ static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {
 static const struct amdgpu_ring_funcs vcn_v1_0_dec_ring_vm_funcs = {
        .type = AMDGPU_RING_TYPE_VCN_DEC,
        .align_mask = 0xf,
-       .nop = PACKET0(0x81ff, 0),
        .support_64bit_ptrs = false,
        .vmhub = AMDGPU_MMHUB,
        .get_rptr = vcn_v1_0_dec_ring_get_rptr,
@@ -1101,7 +1103,7 @@ static const struct amdgpu_ring_funcs vcn_v1_0_dec_ring_vm_funcs = {
        .emit_vm_flush = vcn_v1_0_dec_ring_emit_vm_flush,
        .test_ring = amdgpu_vcn_dec_ring_test_ring,
        .test_ib = amdgpu_vcn_dec_ring_test_ib,
-       .insert_nop = vcn_v1_0_ring_insert_nop,
+       .insert_nop = vcn_v1_0_dec_ring_insert_nop,
        .insert_start = vcn_v1_0_dec_ring_insert_start,
        .insert_end = vcn_v1_0_dec_ring_insert_end,
        .pad_ib = amdgpu_ring_generic_pad_ib,
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CADnq5_PVjamazgFy5McRsHddbDONdi6cEt3JVvooL6THM8LSqw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

author
#8 lore raw
Quoted 6 lines · Alex Deucher
Quoted 3 lines · Leo Liu

NO_OP register should be writen to 0

We discussed this when we first started working on amdgpu. Does it have to be 0?

Yes. I confirmed with FW engineer that we need put 0 into noop.

Quoted 2 lines

This function is used for padding. What happens if we
need an odd number of dwords of padding required?

That should be never happening. should be always paired of PM4 packet for RBC to process.

Regards,
Leo

Quoted 53 lines

Alex

Quoted 50 lines
---
  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +8 -7
index 0501746b..7fbbdb1 100644
@@ -1048,14 +1048,17 @@ static int vcn_v1_0_process_interrupt(struct amdgpu_device *adev,
         return 0;
  }
 
-static void vcn_v1_0_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
+static void vcn_v1_0_dec_ring_insert_nop(struct amdgpu_ring *ring, uint32_t count)
  {
-       int i;
         struct amdgpu_device *adev = ring->adev;
+       int i;
 
-       for (i = 0; i < count; i++)
-               amdgpu_ring_write(ring, PACKET0(SOC15_REG_OFFSET(UVD, 0, mmUVD_NO_OP), 0));
+       WARN_ON(ring->wptr % 2 || count % 2);
 
+       for (i = 0; i < count / 2; i++) {
+               amdgpu_ring_write(ring, PACKET0(SOC15_REG_OFFSET(UVD, 0, mmUVD_NO_OP), 0));
+               amdgpu_ring_write(ring, 0);
+       }
  }
 
 
@@ -1082,7 +1085,6 @@ static const struct amd_ip_funcs vcn_v1_0_ip_funcs = {
  static const struct amdgpu_ring_funcs vcn_v1_0_dec_ring_vm_funcs = {
         .type = AMDGPU_RING_TYPE_VCN_DEC,
         .align_mask = 0xf,
-       .nop = PACKET0(0x81ff, 0),
         .support_64bit_ptrs = false,
         .vmhub = AMDGPU_MMHUB,
         .get_rptr = vcn_v1_0_dec_ring_get_rptr,
@@ -1101,7 +1103,7 @@ static const struct amdgpu_ring_funcs vcn_v1_0_dec_ring_vm_funcs = {
         .emit_vm_flush = vcn_v1_0_dec_ring_emit_vm_flush,
         .test_ring = amdgpu_vcn_dec_ring_test_ring,
         .test_ib = amdgpu_vcn_dec_ring_test_ib,
-       .insert_nop = vcn_v1_0_ring_insert_nop,
+       .insert_nop = vcn_v1_0_dec_ring_insert_nop,
         .insert_start = vcn_v1_0_dec_ring_insert_start,
         .insert_end = vcn_v1_0_dec_ring_insert_end,
         .pad_ib = amdgpu_ring_generic_pad_ib,
--

2.7.4

Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): b4727927-0e7e-0236-11c8-22a837b70bf9-5C7GfCeVMHo@public.gmane.org

Reviewed-by
#10 lore raw
Quoted 13 lines · Leo Liu
Quoted 9 lines · Alex Deucher
Quoted 4 lines · Leo Liu

NO_OP register should be writen to 0

We discussed this when we first started working on amdgpu. Does it have to be 0?

Quoted 7 lines

Yes. I confirmed with FW engineer that we need put 0 into noop.

Quoted 2 lines

This function is used for padding. What happens if we
need an odd number of dwords of padding required?

That should be never happening. should be always paired of PM4 packet for RBC to process.

Cool. Series is:

Quoted 67 lines

Regards,
Leo

Quoted 61 lines

Alex

Quoted 58 lines
---
  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 14 ++++++++------
  1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +5 -4
index 0501746b..7fbbdb1 100644
@@ -1048,14 +1048,17 @@ static int vcn_v1_0_process_interrupt(struct
 amdgpu_device *adev,
         return 0;
  }
 
-static void vcn_v1_0_ring_insert_nop(struct amdgpu_ring *ring, uint32_t
 count)
+static void vcn_v1_0_dec_ring_insert_nop(struct amdgpu_ring *ring,
 uint32_t count)
  {
-       int i;
         struct amdgpu_device *adev = ring->adev;
+       int i;
 
-       for (i = 0; i < count; i++)
-               amdgpu_ring_write(ring, PACKET0(SOC15_REG_OFFSET(UVD, 0,
 mmUVD_NO_OP), 0));
+       WARN_ON(ring->wptr % 2 || count % 2);
 
+       for (i = 0; i < count / 2; i++) {
+               amdgpu_ring_write(ring, PACKET0(SOC15_REG_OFFSET(UVD, 0,

mmUVD_NO_OP), 0));

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2 -1
+               amdgpu_ring_write(ring, 0);
+       }
  }
@@ -1082,7 +1085,6 @@ static const struct amd_ip_funcs vcn_v1_0_ip_funcs
 = {
  static const struct amdgpu_ring_funcs vcn_v1_0_dec_ring_vm_funcs = {
         .type = AMDGPU_RING_TYPE_VCN_DEC,
         .align_mask = 0xf,
-       .nop = PACKET0(0x81ff, 0),
         .support_64bit_ptrs = false,
         .vmhub = AMDGPU_MMHUB,
         .get_rptr = vcn_v1_0_dec_ring_get_rptr,
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -1
@@ -1101,7 +1103,7 @@ static const struct amdgpu_ring_funcs
 vcn_v1_0_dec_ring_vm_funcs = {
         .emit_vm_flush = vcn_v1_0_dec_ring_emit_vm_flush,
         .test_ring = amdgpu_vcn_dec_ring_test_ring,
         .test_ib = amdgpu_vcn_dec_ring_test_ib,
-       .insert_nop = vcn_v1_0_ring_insert_nop,
+       .insert_nop = vcn_v1_0_dec_ring_insert_nop,
         .insert_start = vcn_v1_0_dec_ring_insert_start,
         .insert_end = vcn_v1_0_dec_ring_insert_end,

.pad_ib = amdgpu_ring_generic_pad_ib,
--
2.7.4

Quoted 6 lines
Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): CADnq5_MqMdd7Aw5WJ1TDzuh9j8-i9PwTF9EDAm6FrtbmB-p4oQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

Reviewed-by
#12 lore raw

Am 17.05.2018 um 20:25 schrieb Alex Deucher:

Quoted 7 lines · Leo Liu
Quoted 6 lines · Alex Deucher
Quoted 4 lines · Leo Liu
Quoted 3 lines

NO_OP register should be writen to 0

Quoted 8 lines
Quoted 8 lines
Quoted 2 lines

We discussed this when we first started working on amdgpu. Does it have to be 0?

Yes. I confirmed with FW engineer that we need put 0 into noop.

Quoted 2 lines

This function is used for padding. What happens if we
need an odd number of dwords of padding required?

That should be never happening. should be always paired of PM4 packet for RBC to process.

Good to know.

Quoted 2 lines

Cool. Series is:

Quoted 71 lines
Quoted 66 lines

Regards,
Leo

Quoted 60 lines

Alex

Quoted 58 lines
---
   drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 14 ++++++++------
   1 file changed, 8 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +5 -4
index 0501746b..7fbbdb1 100644
@@ -1048,14 +1048,17 @@ static int vcn_v1_0_process_interrupt(struct
 amdgpu_device *adev,
          return 0;
   }
 
-static void vcn_v1_0_ring_insert_nop(struct amdgpu_ring *ring, uint32_t
 count)
+static void vcn_v1_0_dec_ring_insert_nop(struct amdgpu_ring *ring,
 uint32_t count)
   {
-       int i;
          struct amdgpu_device *adev = ring->adev;
+       int i;
 
-       for (i = 0; i < count; i++)
-               amdgpu_ring_write(ring, PACKET0(SOC15_REG_OFFSET(UVD, 0,
 mmUVD_NO_OP), 0));
+       WARN_ON(ring->wptr % 2 || count % 2);
 
+       for (i = 0; i < count / 2; i++) {
+               amdgpu_ring_write(ring, PACKET0(SOC15_REG_OFFSET(UVD, 0,

mmUVD_NO_OP), 0));

drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +2 -1
+               amdgpu_ring_write(ring, 0);
+       }
   }
@@ -1082,7 +1085,6 @@ static const struct amd_ip_funcs vcn_v1_0_ip_funcs
 = {
   static const struct amdgpu_ring_funcs vcn_v1_0_dec_ring_vm_funcs = {
          .type = AMDGPU_RING_TYPE_VCN_DEC,
          .align_mask = 0xf,
-       .nop = PACKET0(0x81ff, 0),
          .support_64bit_ptrs = false,
          .vmhub = AMDGPU_MMHUB,
          .get_rptr = vcn_v1_0_dec_ring_get_rptr,
drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c +1 -1
@@ -1101,7 +1103,7 @@ static const struct amdgpu_ring_funcs
 vcn_v1_0_dec_ring_vm_funcs = {
          .emit_vm_flush = vcn_v1_0_dec_ring_emit_vm_flush,
          .test_ring = amdgpu_vcn_dec_ring_test_ring,
          .test_ib = amdgpu_vcn_dec_ring_test_ib,
-       .insert_nop = vcn_v1_0_ring_insert_nop,
+       .insert_nop = vcn_v1_0_dec_ring_insert_nop,
          .insert_start = vcn_v1_0_dec_ring_insert_start,
          .insert_end = vcn_v1_0_dec_ring_insert_end,

.pad_ib = amdgpu_ring_generic_pad_ib,
--
2.7.4

Quoted 5 lines
Quoted 4 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx