drm/amdgpu: Fixup VCN IB emission
Subsystems (2)
PATCH 1/1 drm/amdgpu: Fixup VCN IB emission
A mistake crept in
commit [SHA TBD]
After the VCN unified header is emitted the rest of the commands must not overwrite them but append to the buffer.
Signed-off-by Tvrtko Ursulin <[email protected]>
Cc Alex Deucher <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +9 -3
@@ -815,7 +815,7 @@ static int amdgpu_vcn_dec_sw_send_msg(struct amdgpu_ring *ring, goto err; ib = &job->ibs[0 ]; - ptr = ib->ptr; + ib->length_dw =0 ;/* single queue headers */ if (adev->vcn.inst[ring->me].using_unified_queue) {
@@ -824,6 +824,8 @@ static int amdgpu_vcn_dec_sw_send_msg(struct amdgpu_ring *ring, ib_checksum =amdgpu_vcn_unified_ring_ib_header (ib, ib_pack_in_dw, false); } + ptr = &ib->ptr[ib->length_dw]; + *ptr++ =sizeof (struct amdgpu_vcn_decode_buffer ) +8 ; *ptr++ =cpu_to_le32 (AMDGPU_VCN_IB_FLAG_DECODE_BUFFER ); decode_buffer = (struct amdgpu_vcn_decode_buffer *)ptr;
@@ -947,12 +949,14 @@ static int amdgpu_vcn_enc_get_create_msg(struct amdgpu_ring *ring, uint32_t handreturn r; ib = &job->ibs[0 ]; - ptr = ib->ptr; + ib->length_dw =0 ; addr =AMDGPU_GPU_PAGE_ALIGN (ib_msg->gpu_addr);if (adev->vcn.inst[ring->me].using_unified_queue) ib_checksum =amdgpu_vcn_unified_ring_ib_header (ib,0x11 , true); + ptr = &ib->ptr[ib->length_dw]; + *ptr++ =0x00000018 ; *ptr++ =0x00000001 ;/* session info */ *ptr++ = handle;
@@ -1016,12 +1020,14 @@ static int amdgpu_vcn_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t hanreturn r; ib = &job->ibs[0 ]; - ptr = ib->ptr; + ib->length_dw =0 ; addr =AMDGPU_GPU_PAGE_ALIGN (ib_msg->gpu_addr);if (adev->vcn.inst[ring->me].using_unified_queue) ib_checksum =amdgpu_vcn_unified_ring_ib_header (ib,0x11 , true); + ptr = &ib->ptr[ib->length_dw]; + *ptr++ =0x00000018 ; *ptr++ =0x00000001 ; *ptr++ = handle;
Signature · 1 line
2.48.0