drm/amdgpu: IB size alignment on VCN5
Subsystems (2)
PATCH 1/2 drm/amdgpu: IB size alignment on VCN5
From: Sonny Jiang <[email protected]>
VCN5 IB size alignment adjusted.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1 -1
@@ -509,7 +509,7 @@ static int amdgpu_hw_ip_info(struct amdgpu_device *adev, ++num_rings; } ib_start_alignment =256 ; - ib_size_alignment =4 ; + ib_size_alignment =64 ;break ;case AMDGPU_HW_IP_VCN_JPEG : type = (amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_JPEG)) ?
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +3 -3
@@ -731,7 +731,7 @@ static int amdgpu_vcn_dec_sw_send_msg(struct amdgpu_ring *ring,int i, r;if (sq) - ib_size_dw +=8 ; + ib_size_dw +=16 ; r = amdgpu_job_alloc_with_ib(ring->adev, NULL, NULL, ib_size_dw * 4, AMDGPU_IB_POOL_DIRECT,
@@ -861,7 +861,7 @@ static int amdgpu_vcn_enc_get_create_msg(struct amdgpu_ring *ring, uint32_t handint i, r;if (sq) - ib_size_dw +=8 ; + ib_size_dw +=16 ; r = amdgpu_job_alloc_with_ib(ring->adev, NULL, NULL, ib_size_dw * 4, AMDGPU_IB_POOL_DIRECT,
@@ -928,7 +928,7 @@ static int amdgpu_vcn_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t hanint i, r;if (sq) - ib_size_dw +=8 ; + ib_size_dw +=16 ; r = amdgpu_job_alloc_with_ib(ring->adev, NULL, NULL, ib_size_dw * 4, AMDGPU_IB_POOL_DIRECT,
Signature · 1 line
2.43.2
PATCH 2/2 drm/amdgpu: IB test encode test package change for VCN5
From: Sonny Jiang <[email protected]>
VCN5 session info package interface changed
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +2 -2
@@ -882,7 +882,7 @@ static int amdgpu_vcn_enc_get_create_msg(struct amdgpu_ring *ring, uint32_t hand ib->ptr[ib->length_dw++] = handle; ib->ptr[ib->length_dw++] =upper_32_bits (addr); ib->ptr[ib->length_dw++] = addr; - ib->ptr[ib->length_dw++] =0x0000000b ; + ib->ptr[ib->length_dw++] =0x00000000 ; ib->ptr[ib->length_dw++] =0x00000014 ; ib->ptr[ib->length_dw++] =0x00000002 ;/* task info */
@@ -949,7 +949,7 @@ static int amdgpu_vcn_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t han ib->ptr[ib->length_dw++] = handle; ib->ptr[ib->length_dw++] =upper_32_bits (addr); ib->ptr[ib->length_dw++] = addr; - ib->ptr[ib->length_dw++] =0x0000000b ; + ib->ptr[ib->length_dw++] =0x00000000 ; ib->ptr[ib->length_dw++] =0x00000014 ; ib->ptr[ib->length_dw++] =0x00000002 ;
Signature · 1 line
2.43.2
Re: [PATCH 2/2] drm/amdgpu: IB test encode test package change for VCN5
Quoted 24 lines · Sonny Jiang
From: Sonny Jiang <[email protected]>
VCN5 session info package interface changed
Signed-off-by Sonny Jiang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1@@ -882,7 +882,7 @@ static int amdgpu_vcn_enc_get_create_msg(struct amdgpu_ring *ring, uint32_t hand ib->ptr[ib->length_dw++] = handle; ib->ptr[ib->length_dw++] =upper_32_bits (addr); ib->ptr[ib->length_dw++] = addr; - ib->ptr[ib->length_dw++] =0x0000000b ; + ib->ptr[ib->length_dw++] =0x00000000 ; ib->ptr[ib->length_dw++] =0x00000014 ; ib->ptr[ib->length_dw++] =0x00000002 ;/* task info */
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c static int amdgpu_vcn_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t han · line 952
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1@@ -949,7 +949,7 @@ static int amdgpu_vcn_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t han ib->ptr[ib->length_dw++] = handle; ib->ptr[ib->length_dw++] =upper_32_bits (addr); ib->ptr[ib->length_dw++] = addr; - ib->ptr[ib->length_dw++] =0x0000000b ; + ib->ptr[ib->length_dw++] =0x00000000 ;
These patches are touching common files, are these changes safe on pre-VCN5 IPs?
Alex
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0
-1ib->ptr[ib->length_dw++] =0x00000014 ; ib->ptr[ib->length_dw++] =0x00000002 ; --2.43.2
Re: [PATCH 2/2] drm/amdgpu: IB test encode test package change for VCN5
[AMD Official Use Only - General]
These changes are for vcn_unified_ring_test_ib which only used on VCN4 and VCN5. The only exception is ib_size_alignment of hw_ip_info.
The VCN5 adds address_patch_enabled in session_info. VCN4 doesn't have it, so it should just ignore the extra 0.
typedef struct uve_session_info_s
{
unsigned int interface_version; ///< The version of the firmware interface on which the host was built
unsigned int sw_context_address_hi; ///< High address of software context buffer
unsigned int sw_context_address_lo; ///< Low address of software context buffer
unsigned int address_patch_enabled; ///< address patching enabled in UMD} uve_session_info_t;
By my tests, I didn't find error. I may need more tests on mi300 asic.
Thanks,
Sonny
________________________________
From: Alex Deucher <[email protected]>
Sent: Monday, April 15, 2024 5:32 PM
To: Jiang, Sonny <[email protected]>
Cc: [email protected] <[email protected]>; Jiang, Sonny <[email protected]>
Subject: Re: [PATCH 2/2] drm/amdgpu: IB test encode test package change for VCN5
Quoted 24 lines · Sonny Jiang
From: Sonny Jiang <[email protected]>
VCN5 session info package interface changed
Signed-off-by Sonny Jiang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1@@ -882,7 +882,7 @@ static int amdgpu_vcn_enc_get_create_msg(struct amdgpu_ring *ring, uint32_t hand ib->ptr[ib->length_dw++] = handle; ib->ptr[ib->length_dw++] =upper_32_bits (addr); ib->ptr[ib->length_dw++] = addr; - ib->ptr[ib->length_dw++] =0x0000000b ; + ib->ptr[ib->length_dw++] =0x00000000 ; ib->ptr[ib->length_dw++] =0x00000014 ; ib->ptr[ib->length_dw++] =0x00000002 ;/* task info */
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c static int amdgpu_vcn_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t han · line 952
Quoted 5 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1@@ -949,7 +949,7 @@ static int amdgpu_vcn_enc_get_destroy_msg(struct amdgpu_ring *ring, uint32_t han ib->ptr[ib->length_dw++] = handle; ib->ptr[ib->length_dw++] =upper_32_bits (addr); ib->ptr[ib->length_dw++] = addr; - ib->ptr[ib->length_dw++] =0x0000000b ; + ib->ptr[ib->length_dw++] =0x00000000 ;
These patches are touching common files, are these changes safe on pre-VCN5 IPs?
Alex
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +0
-1ib->ptr[ib->length_dw++] =0x00000014 ; ib->ptr[ib->length_dw++] =0x00000002 ; --2.43.2
[AMD Official Use Only - General]
Quoted 25 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Sonny Jiang
Sent: Monday, April 15, 2024 5:25 PM
To: [email protected]
Cc: Jiang, Sonny <[email protected]>; Jiang, Sonny <[email protected]>
Subject: [PATCH 1/2] drm/amdgpu: IB size alignment on VCN5From: Sonny Jiang <[email protected]>
VCN5 IB size alignment adjusted.
Signed-off-by Sonny Jiang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c static int amdgpu_hw_ip_info(struct amdgpu_device · line 513
Quoted 6 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +1
-1@@ -509,7 +509,7 @@ static int amdgpu_hw_ip_info(struct amdgpu_device *adev, ++num_rings; } ib_start_alignment =256 ; - ib_size_alignment =4 ; + ib_size_alignment =64 ;
We don't want these impact on previous HW if that is really required.
Regards,
Leo
Quoted 42 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +0
-0break ;case AMDGPU_HW_IP_VCN_JPEG :type = (amdgpu_device_ip_get_ip_block(adev,
AMD_IP_BLOCK_TYPE_JPEG)) ?drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1@@ -731,7 +731,7 @@ static int amdgpu_vcn_dec_sw_send_msg(structamdgpu_ring *ring, int i, r;if (sq) - ib_size_dw +=8 ; + ib_size_dw +=16 ; r = amdgpu_job_alloc_with_ib(ring->adev, NULL, NULL,ib_size_dw * 4, AMDGPU_IB_POOL_DIRECT, @@ -861,7 +861,7 @@ static int amdgpu_vcn_enc_get_create_msg(struct amdgpu_ring *ring, uint32_t hand int i, r; if (sq)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1- ib_size_dw +=8 ; + ib_size_dw +=16 ; r = amdgpu_job_alloc_with_ib(ring->adev, NULL, NULL, ib_size_dw * 4,
AMDGPU_IB_POOL_DIRECT, @@ -928,7 +928,7 @@ static int amdgpu_vcn_enc_get_destroy_msg(structamdgpu_ring*ring,uint32_thanint i, r; if (sq)drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +1
-1- ib_size_dw +=8 ; + ib_size_dw +=16 ; r = amdgpu_job_alloc_with_ib(ring->adev, NULL, NULL, ib_size_dw * 4,
AMDGPU_IB_POOL_DIRECT,
--
2.43.2