aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorChristian König2017-09-07 03:16:01 -0500
committerChristian König2017-10-04 03:47:49 -0500
commit736ef0b61cab55378202c5f49d91799cc2b99091 (patch)
tree77b744985df17389d82bd3f11189046162376edd /tests
parent1dd84e01a972b1759839a7326009be24ab3e6de2 (diff)
downloadexternal-libgbm-736ef0b61cab55378202c5f49d91799cc2b99091.tar.gz
external-libgbm-736ef0b61cab55378202c5f49d91799cc2b99091.tar.xz
external-libgbm-736ef0b61cab55378202c5f49d91799cc2b99091.zip
amdgpu: make userptr unit test more interesting
Do a fork() to force some MMU callbacks. Signed-off-by: Christian König <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/amdgpu/basic_tests.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c
index 80d15e77..18bcf919 100644
--- a/tests/amdgpu/basic_tests.c
+++ b/tests/amdgpu/basic_tests.c
@@ -31,6 +31,7 @@
31#ifdef HAVE_ALLOCA_H 31#ifdef HAVE_ALLOCA_H
32# include <alloca.h> 32# include <alloca.h>
33#endif 33#endif
34#include <sys/wait.h>
34 35
35#include "CUnit/Basic.h" 36#include "CUnit/Basic.h"
36 37
@@ -1403,6 +1404,11 @@ static void amdgpu_userptr_test(void)
1403 while (j++ < sdma_write_length) 1404 while (j++ < sdma_write_length)
1404 pm4[i++] = 0xdeadbeaf; 1405 pm4[i++] = 0xdeadbeaf;
1405 1406
1407 if (!fork()) {
1408 pm4[0] = 0x0;
1409 exit(0);
1410 }
1411
1406 amdgpu_test_exec_cs_helper(context_handle, 1412 amdgpu_test_exec_cs_helper(context_handle,
1407 AMDGPU_HW_IP_DMA, 0, 1413 AMDGPU_HW_IP_DMA, 0,
1408 i, pm4, 1414 i, pm4,
@@ -1426,4 +1432,6 @@ static void amdgpu_userptr_test(void)
1426 1432
1427 r = amdgpu_cs_ctx_free(context_handle); 1433 r = amdgpu_cs_ctx_free(context_handle);
1428 CU_ASSERT_EQUAL(r, 0); 1434 CU_ASSERT_EQUAL(r, 0);
1435
1436 wait(NULL);
1429} 1437}