tests/amdgpu: move decode sum to common
authorLeo Liu <leo.liu@amd.com>
Mon, 3 Apr 2017 18:59:15 +0000 (14:59 -0400)
committerLeo Liu <leo.liu@amd.com>
Mon, 5 Jun 2017 14:41:13 +0000 (10:41 -0400)
Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
tests/amdgpu/cs_tests.c
tests/amdgpu/decode_messages.h

index fe78326..081ec9c 100644 (file)
@@ -378,7 +378,7 @@ static void amdgpu_cs_uvd_decode(void)
        /* TODO: use a real CRC32 */
        for (i = 0, sum = 0; i < dt_size; ++i)
                sum += ptr[i];
-       CU_ASSERT_EQUAL(sum, 0x20345d8);
+       CU_ASSERT_EQUAL(sum, SUM_DECODE);
 
        r = amdgpu_bo_cpu_unmap(buf_handle);
        CU_ASSERT_EQUAL(r, 0);
index edfba3b..c5c96f8 100644 (file)
@@ -24,6 +24,8 @@
 #ifndef _DECODE_MESSAGES_H_
 #define _DECODE_MESSAGES_H_
 
+#define SUM_DECODE 0x20345d8
+
 static const uint8_t uvd_create_msg[] = {
        0xe4,0x0d,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x44,0x40,0x00,0x00,0x00,0x00,
        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x60,0x03,0x00,0x00,