diff options
author | Andrey Grodzovsky <andrey.grodzovsky@amd.com> | 2017-11-24 15:19:09 -0500 |
---|---|---|
committer | Andrey Grodzovsky <andrey.grodzovsky@amd.com> | 2017-11-30 14:51:12 -0500 |
commit | bc21168fa924d3fc4a000492e861f50a1a135b25 (patch) | |
tree | 3cd56f6c934e85f709e16db650504a341793ccad /tests/amdgpu/amdgpu_test.c | |
parent | f71e95108de9a414226b0421ae2af99902ea28a5 (diff) | |
download | external_libdrm-bc21168fa924d3fc4a000492e861f50a1a135b25.tar.gz external_libdrm-bc21168fa924d3fc4a000492e861f50a1a135b25.tar.bz2 external_libdrm-bc21168fa924d3fc4a000492e861f50a1a135b25.zip |
amdgpu: Add explicit dependency test.
The test is as following:
1) Create context A & B
2) Send a command submission using context A which fires up a compute shader.
3) The shader wait a bit and then write a value to a memory location.
4) Send a command submission using context B which writes another value to the same memory location, but having an explicit dependency on the first command submission.
5) Wait with the CPU for both submissions to finish and inspect the written value.
Test passes if the value seen in the memory location after both submissions is from command B.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'tests/amdgpu/amdgpu_test.c')
-rw-r--r-- | tests/amdgpu/amdgpu_test.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/amdgpu/amdgpu_test.c b/tests/amdgpu/amdgpu_test.c index 50da17ca..8fa3399a 100644 --- a/tests/amdgpu/amdgpu_test.c +++ b/tests/amdgpu/amdgpu_test.c @@ -49,6 +49,7 @@ #include "CUnit/Basic.h" #include "amdgpu_test.h" +#include "amdgpu_internal.h" /* Test suit names */ #define BASIC_TESTS_STR "Basic Tests" @@ -401,9 +402,20 @@ static int amdgpu_find_device(uint8_t bus, uint16_t dev) static void amdgpu_disable_suits() { + amdgpu_device_handle device_handle; + uint32_t major_version, minor_version, family_id; int i; int size = sizeof(suites_active_stat) / sizeof(suites_active_stat[0]); + if (amdgpu_device_initialize(drm_amdgpu[0], &major_version, + &minor_version, &device_handle)) + return; + + family_id = device_handle->info.family_id; + + if (amdgpu_device_deinitialize(device_handle)) + return; + /* Set active status for suits based on their policies */ for (i = 0; i < size; ++i) if (amdgpu_set_suite_active(suites_active_stat[i].pName, @@ -420,6 +432,12 @@ static void amdgpu_disable_suits() if (amdgpu_set_test_active(BO_TESTS_STR, "Metadata", CU_FALSE)) fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg()); + + + /* This test was ran on GFX8 and GFX9 only */ + if (family_id < AMDGPU_FAMILY_VI || family_id > AMDGPU_FAMILY_RV) + if (amdgpu_set_test_active(BASIC_TESTS_STR, "Sync dependency Test", CU_FALSE)) + fprintf(stderr, "test deactivation failed - %s\n", CU_get_error_msg()); } /* The main() function for setting up and running the tests. |