[PATCH v2 2/2] drm/amdgpu: update kernel vcn ring test
Saleemkhan Jamadar
saleemkhan.jamadar at amd.com
Mon Jul 10 08:23:57 UTC 2023
add session context buffer to decoder ring test for vcn v1 to v3.
v2 - add the buffer into IB (Leo liu)
Signed-off-by: Saleemkhan Jamadar <saleemkhan.jamadar at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
index 76e9a2418286..4c44d76f69de 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
@@ -521,6 +521,7 @@ static int amdgpu_vcn_dec_send_msg(struct amdgpu_ring *ring,
struct dma_fence **fence)
{
u64 addr = AMDGPU_GPU_PAGE_ALIGN(ib_msg->gpu_addr);
+ uint64_t session_ctx_buf_gaddr = AMDGPU_GPU_PAGE_ALIGN(ib_msg->gpu_addr + 8192);
struct amdgpu_device *adev = ring->adev;
struct dma_fence *f = NULL;
struct amdgpu_job *job;
@@ -546,6 +547,17 @@ static int amdgpu_vcn_dec_send_msg(struct amdgpu_ring *ring,
}
ib->length_dw = 16;
+ ib->ptr[ib->length_dw++] = PACKET0(adev->vcn.internal.data0, 0);
+ ib->ptr[ib->length_dw++] = lower_32_bits(session_ctx_buf_gaddr);
+ ib->ptr[ib->length_dw++] = PACKET0(adev->vcn.internal.data1, 0);
+ ib->ptr[ib->length_dw++] = upper_32_bits(session_ctx_buf_gaddr);
+ ib->ptr[ib->length_dw++] = PACKET0(adev->vcn.internal.cmd, 0);
+ ib->ptr[ib->length_dw++] = 0;
+ for (i = ib->length_dw; i < 32; i += 2) {
+ ib->ptr[i] = PACKET0(adev->vcn.internal.nop, 0);
+ ib->ptr[i+1] = 0;
+ }
+
r = amdgpu_job_submit_direct(job, ring, &f);
if (r)
goto err_free;
--
2.25.1
More information about the amd-gfx
mailing list