add vcn unit tests
cover add vcn unit tests
The series is to add vcn unit tests for decode, and have the common from previous uvd unit test to be shared with vcn decode.
Leo Liu (5):
tests/amdgpu: rename uvd messages to decode messages tests/amdgpu: separate decode messages tests/amdgpu: move decode sum to common tests/amdgpu: add vcn tests support and sets tests/amdgpu: implement vcn dec unit tests
tests/amdgpu/Makefile.am | 3 +- tests/amdgpu/amdgpu_test.c | 6 + tests/amdgpu/amdgpu_test.h | 15 + tests/amdgpu/cs_tests.c | 7 +- tests/amdgpu/decode_messages.h | 848 +++++++++++++++++++++++++++++++++++++++++ tests/amdgpu/uvd_messages.h | 813 --------------------------------------- tests/amdgpu/vcn_tests.c | 410 ++++++++++++++++++++ 7 files changed, 1285 insertions(+), 817 deletions(-) create mode 100644 tests/amdgpu/decode_messages.h delete mode 100644 tests/amdgpu/uvd_messages.h create mode 100644 tests/amdgpu/vcn_tests.c
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/5 tests/amdgpu: rename uvd messages to decode messages
It will be shared with VCN decode
--- tests/amdgpu/cs_tests.c | 2 +- tests/amdgpu/decode_messages.h | 813 +++++++++++++++++++++++++++++++++++++++++ tests/amdgpu/uvd_messages.h | 813 ----------------------------------------- 3 files changed, 814 insertions(+), 814 deletions(-) create mode 100644 tests/amdgpu/decode_messages.h delete mode 100644 tests/amdgpu/uvd_messages.h
tests/amdgpu/cs_tests.c +1 -1
@@ -32,7 +32,7 @@#include "util_math.h" #include "amdgpu_test.h" -#include "uvd_messages.h" +#include "decode_messages.h" #include "amdgpu_drm.h" #include "amdgpu_internal.h"
tests/amdgpu/decode_messages.h new file +813 -0
813 lines not on this page · raw message
tests/amdgpu/uvd_messages.h deleted +0 -813
813 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 2/5 tests/amdgpu: separate decode messages
In reply to a message not in the archiveAVC decode messages will be common with VCN decode
--- tests/amdgpu/cs_tests.c | 3 ++- tests/amdgpu/decode_messages.h | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-)
tests/amdgpu/cs_tests.c +2 -1
@@ -289,7 +289,8 @@ static void amdgpu_cs_uvd_decode(void) r =amdgpu_bo_cpu_map (buf_handle, (void **)&ptr);CU_ASSERT_EQUAL (r,0 ); -memcpy (ptr, uvd_decode_msg,sizeof (uvd_create_msg)); +memcpy (ptr, uvd_decode_msg,sizeof (uvd_decode_msg)); +memcpy (ptr +sizeof (uvd_decode_msg), avc_decode_msg,sizeof (avc_decode_msg));if (family_id >=AMDGPU_FAMILY_VI ) { ptr[0x10 ] =7 ;
tests/amdgpu/decode_messages.h +3 -0
@@ -356,6 +356,9 @@ static const uint8_t uvd_decode_msg[] = {0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, +}; + +static const uint8_t avc_decode_msg[] = {0x02 ,0x00 ,0x00 ,0x00 ,0x1e ,0x00 ,0x00 ,0x00 ,0x05 ,0x00 ,0x00 ,0x00 ,0x88 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x00 ,0x01 ,0x00 ,0x03 ,0x02 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , 0x00,0x00,0x00,0x00,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 3/5 tests/amdgpu: move decode sum to common
In reply to a message not in the archive--- tests/amdgpu/cs_tests.c | 2 +- tests/amdgpu/decode_messages.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
tests/amdgpu/cs_tests.c +1 -1
@@ -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 );
tests/amdgpu/decode_messages.h +2 -0
@@ -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,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 4/5 tests/amdgpu: add vcn tests support and sets
In reply to a message not in the archive--- tests/amdgpu/Makefile.am | 3 +- tests/amdgpu/amdgpu_test.c | 6 + tests/amdgpu/amdgpu_test.h | 15 +++ tests/amdgpu/vcn_tests.c | 277 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 300 insertions(+), 1 deletion(-) create mode 100644 tests/amdgpu/vcn_tests.c
tests/amdgpu/Makefile.am +2 -1
@@ -26,4 +26,5 @@ amdgpu_test_SOURCES = \ uvd_messages.h \ vce_tests.c \ vce_ib.h \ - frame.h + frame.h \ + vcn_tests.c
tests/amdgpu/amdgpu_test.c +6 -0
@@ -85,6 +85,12 @@ static CU_SuiteInfo suites[] = { .pCleanupFunc = suite_vce_tests_clean, .pTests = vce_tests, }, + { + .pName = "VCN Tests", + .pInitFunc = suite_vcn_tests_init, + .pCleanupFunc = suite_vcn_tests_clean, + .pTests = vcn_tests, + }, CU_SUITE_INFO_NULL, };
tests/amdgpu/amdgpu_test.h +15 -0
@@ -105,6 +105,21 @@ int suite_vce_tests_clean();extern CU_TestInfo vce_tests[];/** ++ * Initialize vcn test suite ++ */ +int suite_vcn_tests_init (); + +/** ++ * Deinitialize vcn test suite ++ */ +int suite_vcn_tests_clean (); + +/** ++ * Tests in vcn test suite ++ */ +extern CU_TestInfo vcn_tests[]; + +/** * Helper functions */ static inline amdgpu_bo_handle gpu_mem_alloc(
tests/amdgpu/vcn_tests.c new file +277 -0
277 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
PATCH 5/5 tests/amdgpu: implement vcn dec unit tests
In reply to a message not in the archive--- tests/amdgpu/decode_messages.h | 30 +++++++++ tests/amdgpu/vcn_tests.c | 139 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 166 insertions(+), 3 deletions(-)
tests/amdgpu/decode_messages.h +30 -0
@@ -815,4 +815,34 @@ static const uint8_t uvd_it_scaling_table[] = { 0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10,0x10, }; +static const uint8_t vcn_dec_create_msg[] = { +0x28 ,0x00 ,0x00 ,0x00 ,0x38 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x03 ,0x00 ,0x44 ,0x40 ,0x00 ,0x00 ,0x00 ,0x00 ,0x01 ,0x00 ,0x00 ,0x00 ,0x28 ,0x00 ,0x00 ,0x00 , +0x10 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x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0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x04 ,0x00 ,0x00 , +0x00 ,0x02 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x01 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0xc0 ,0x03 ,0x00 ,0x00 ,0x80 ,0x07 ,0x00 ,0x00 ,0x60 ,0x09 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 , +}; + +static const uint8_t vcn_dec_destroy_msg[] = { +0x28 ,0x00 ,0x00 ,0x00 ,0x18 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 , +0x03 ,0x00 ,0x44 ,0x40 ,0x00 ,0x00 ,0x00 ,0x00 , +}; +#endif /* _DECODE_MESSAGES_H_ */
tests/amdgpu/vcn_tests.c +136 -3
170 lines not on this page · raw message
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx