aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJames Zhu2017-10-05 09:57:42 -0500
committerLeo Liu2017-10-06 08:40:06 -0500
commit2ecafcae8a215d9994fb26a122d97bcb5437c5e8 (patch)
tree1c209a3123447a1420e3f37d5b2124a15076022a /tests
parent657b09438bf4978c9597368165c56227013625e9 (diff)
downloadexternal-libgbm-2ecafcae8a215d9994fb26a122d97bcb5437c5e8.tar.gz
external-libgbm-2ecafcae8a215d9994fb26a122d97bcb5437c5e8.tar.xz
external-libgbm-2ecafcae8a215d9994fb26a122d97bcb5437c5e8.zip
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>
Diffstat (limited to 'tests')
-rw-r--r--tests/amdgpu/uvd_enc_tests.c4
-rw-r--r--tests/amdgpu/uve_ib.h4
2 files changed, 5 insertions, 3 deletions
diff --git a/tests/amdgpu/uvd_enc_tests.c b/tests/amdgpu/uvd_enc_tests.c
index 75181035..bbda1312 100644
--- a/tests/amdgpu/uvd_enc_tests.c
+++ b/tests/amdgpu/uvd_enc_tests.c
@@ -272,7 +272,7 @@ static void amdgpu_cs_uvd_enc_create(void)
272static void check_result(struct amdgpu_uvd_enc *enc) 272static void check_result(struct amdgpu_uvd_enc *enc)
273{ 273{
274 uint64_t sum; 274 uint64_t sum;
275 uint32_t s = 26382; 275 uint32_t s = 175602;
276 uint32_t *ptr, size; 276 uint32_t *ptr, size;
277 int i, j, r; 277 int i, j, r;
278 278
@@ -463,6 +463,8 @@ static void amdgpu_cs_uvd_enc_encode(void)
463 ib_cpu[len++] = chroma_offset >> 32; 463 ib_cpu[len++] = chroma_offset >> 32;
464 ib_cpu[len++] = chroma_offset; 464 ib_cpu[len++] = chroma_offset;
465 memcpy((ib_cpu + len), uve_encode_param, sizeof(uve_encode_param)); 465 memcpy((ib_cpu + len), uve_encode_param, sizeof(uve_encode_param));
466 ib_cpu[len] = ALIGN(enc.width, align);
467 ib_cpu[len + 1] = ALIGN(enc.width, align);
466 len += sizeof(uve_encode_param) / 4; 468 len += sizeof(uve_encode_param) / 4;
467 469
468 memcpy((ib_cpu + len), uve_op_speed_enc_mode, sizeof(uve_op_speed_enc_mode)); 470 memcpy((ib_cpu + len), uve_op_speed_enc_mode, sizeof(uve_op_speed_enc_mode));
diff --git a/tests/amdgpu/uve_ib.h b/tests/amdgpu/uve_ib.h
index 9abd4066..cb72be22 100644
--- a/tests/amdgpu/uve_ib.h
+++ b/tests/amdgpu/uve_ib.h
@@ -297,8 +297,8 @@ static const uint32_t uve_slice_header[] = {
297}; 297};
298 298
299static const uint32_t uve_encode_param[] = { 299static const uint32_t uve_encode_param[] = {
300 0x000000a0, 300 0x00000000,
301 0x00000080, 301 0x00000000,
302 0x00000000, 302 0x00000000,
303 0x00000000, 303 0x00000000,
304 0xffffffff, 304 0xffffffff,