tests/amdgpu: fix uvd enc data corruption issue

In uvd encode parameter package, parameters input_pic_luma_pitch and
input_pic_chroma_pitch should be picture width align with hardware alignment.
The hardware alignment is 16 for amdgpu family earlier than AMDGPU_FAMILY_AI,
and 256 for later than and including AMDGPU_FAMILY_AI.

Signed-off-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
main
James Zhu 2017-10-05 10:57:42 -04:00 committed by Leo Liu
parent 657b09438b
commit 2ecafcae8a
2 changed files with 5 additions and 3 deletions

View File

@ -272,7 +272,7 @@ static void amdgpu_cs_uvd_enc_create(void)
static void check_result(struct amdgpu_uvd_enc *enc) static void check_result(struct amdgpu_uvd_enc *enc)
{ {
uint64_t sum; uint64_t sum;
uint32_t s = 26382; uint32_t s = 175602;
uint32_t *ptr, size; uint32_t *ptr, size;
int i, j, r; int i, j, r;
@ -463,6 +463,8 @@ static void amdgpu_cs_uvd_enc_encode(void)
ib_cpu[len++] = chroma_offset >> 32; ib_cpu[len++] = chroma_offset >> 32;
ib_cpu[len++] = chroma_offset; ib_cpu[len++] = chroma_offset;
memcpy((ib_cpu + len), uve_encode_param, sizeof(uve_encode_param)); memcpy((ib_cpu + len), uve_encode_param, sizeof(uve_encode_param));
ib_cpu[len] = ALIGN(enc.width, align);
ib_cpu[len + 1] = ALIGN(enc.width, align);
len += sizeof(uve_encode_param) / 4; len += sizeof(uve_encode_param) / 4;
memcpy((ib_cpu + len), uve_op_speed_enc_mode, sizeof(uve_op_speed_enc_mode)); memcpy((ib_cpu + len), uve_op_speed_enc_mode, sizeof(uve_op_speed_enc_mode));

View File

@ -297,8 +297,8 @@ static const uint32_t uve_slice_header[] = {
}; };
static const uint32_t uve_encode_param[] = { static const uint32_t uve_encode_param[] = {
0x000000a0, 0x00000000,
0x00000080, 0x00000000,
0x00000000, 0x00000000,
0x00000000, 0x00000000,
0xffffffff, 0xffffffff,