[PATCH 10/12] drm/amdgpu: Convert VCE to variadic amdgpu_ring_write()

Tvrtko Ursulin tursulin at igalia.com
Fri Dec 27 11:19:36 UTC 2024


From: Tvrtko Ursulin <tvrtko.ursulin at igalia.com>

Just a small example how the conversion works.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin at igalia.com>
Cc: Christian König <christian.koenig at amd.com>
Cc: Sunil Khatri <sunil.khatri at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
index b9060bcd4806..3fa0b0824836 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
@@ -1069,10 +1069,11 @@ void amdgpu_vce_ring_emit_ib(struct amdgpu_ring *ring,
 				struct amdgpu_ib *ib,
 				uint32_t flags)
 {
-	amdgpu_ring_write(ring, VCE_CMD_IB);
-	amdgpu_ring_write(ring, lower_32_bits(ib->gpu_addr));
-	amdgpu_ring_write(ring, upper_32_bits(ib->gpu_addr));
-	amdgpu_ring_write(ring, ib->length_dw);
+	amdgpu_ring_write(ring,
+			  VCE_CMD_IB,
+			  lower_32_bits(ib->gpu_addr),
+			  upper_32_bits(ib->gpu_addr),
+			  ib->length_dw);
 }
 
 /**
@@ -1089,12 +1090,13 @@ void amdgpu_vce_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seq,
 {
 	WARN_ON(flags & AMDGPU_FENCE_FLAG_64BIT);
 
-	amdgpu_ring_write(ring, VCE_CMD_FENCE);
-	amdgpu_ring_write(ring, addr);
-	amdgpu_ring_write(ring, upper_32_bits(addr));
-	amdgpu_ring_write(ring, seq);
-	amdgpu_ring_write(ring, VCE_CMD_TRAP);
-	amdgpu_ring_write(ring, VCE_CMD_END);
+	amdgpu_ring_write(ring,
+			  VCE_CMD_FENCE,
+			  addr,
+			  upper_32_bits(addr),
+			  seq,
+			  VCE_CMD_TRAP,
+			  VCE_CMD_END);
 }
 
 /**
-- 
2.47.1



More information about the amd-gfx mailing list