diff options
author | Jammy Zhou <Jammy.Zhou@amd.com> | 2015-07-09 13:51:13 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-08-05 13:47:52 -0400 |
commit | f91b56dc8c604ec1c6f092d69550266d20dc9764 (patch) | |
tree | 6952e5b6e93f94a4dc8edb1889e532c229370c9b /tests/amdgpu | |
parent | 12802da74f0e480bbde5a11df689329910893e87 (diff) |
amdgpu: improve the amdgpu_cs_query_fence_status interface
make amdgpu_cs_query_fence reusable to support multi-fence query
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Diffstat (limited to 'tests/amdgpu')
-rw-r--r-- | tests/amdgpu/basic_tests.c | 20 | ||||
-rw-r--r-- | tests/amdgpu/cs_tests.c | 5 | ||||
-rw-r--r-- | tests/amdgpu/vce_tests.c | 5 |
3 files changed, 18 insertions, 12 deletions
diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c index 93743998..f369615e 100644 --- a/tests/amdgpu/basic_tests.c +++ b/tests/amdgpu/basic_tests.c @@ -215,10 +215,11 @@ static void amdgpu_command_submission_gfx_separate_ibs(void) CU_ASSERT_EQUAL(r, 0); fence_status.context = context_handle; - fence_status.timeout_ns = AMDGPU_TIMEOUT_INFINITE; fence_status.ip_type = AMDGPU_HW_IP_GFX; - r = amdgpu_cs_query_fence_status(&fence_status, &expired); + r = amdgpu_cs_query_fence_status(&fence_status, + AMDGPU_TIMEOUT_INFINITE, + 0, &expired); CU_ASSERT_EQUAL(r, 0); r = amdgpu_bo_free(ib_result_handle); @@ -289,10 +290,11 @@ static void amdgpu_command_submission_gfx_shared_ib(void) CU_ASSERT_EQUAL(r, 0); fence_status.context = context_handle; - fence_status.timeout_ns = AMDGPU_TIMEOUT_INFINITE; fence_status.ip_type = AMDGPU_HW_IP_GFX; - r = amdgpu_cs_query_fence_status(&fence_status, &expired); + r = amdgpu_cs_query_fence_status(&fence_status, + AMDGPU_TIMEOUT_INFINITE, + 0, &expired); CU_ASSERT_EQUAL(r, 0); r = amdgpu_bo_free(ib_result_handle); @@ -362,11 +364,12 @@ static void amdgpu_command_submission_compute(void) CU_ASSERT_EQUAL(r, 0); fence_status.context = context_handle; - fence_status.timeout_ns = AMDGPU_TIMEOUT_INFINITE; fence_status.ip_type = AMDGPU_HW_IP_COMPUTE; fence_status.ring = instance; - r = amdgpu_cs_query_fence_status(&fence_status, &expired); + r = amdgpu_cs_query_fence_status(&fence_status, + AMDGPU_TIMEOUT_INFINITE, + 0, &expired); CU_ASSERT_EQUAL(r, 0); r = amdgpu_bo_list_destroy(bo_list); @@ -446,10 +449,11 @@ static void amdgpu_sdma_test_exec_cs(amdgpu_context_handle context_handle, fence_status.ip_type = AMDGPU_HW_IP_DMA; fence_status.ring = ibs_request->ring; fence_status.context = context_handle; - fence_status.timeout_ns = AMDGPU_TIMEOUT_INFINITE; /* wait for IB accomplished */ - r = amdgpu_cs_query_fence_status(&fence_status, &expired); + r = amdgpu_cs_query_fence_status(&fence_status, + AMDGPU_TIMEOUT_INFINITE, + 0, &expired); CU_ASSERT_EQUAL(r, 0); CU_ASSERT_EQUAL(expired, true); diff --git a/tests/amdgpu/cs_tests.c b/tests/amdgpu/cs_tests.c index 63cdbb5b..c303cc30 100644 --- a/tests/amdgpu/cs_tests.c +++ b/tests/amdgpu/cs_tests.c @@ -140,10 +140,11 @@ static int submit(unsigned ndw, unsigned ip) return r; fence_status.context = context_handle; - fence_status.timeout_ns = AMDGPU_TIMEOUT_INFINITE; fence_status.ip_type = ip; - r = amdgpu_cs_query_fence_status(&fence_status, &expired); + r = amdgpu_cs_query_fence_status(&fence_status, + AMDGPU_TIMEOUT_INFINITE, + 0, &expired); if (r) return r; diff --git a/tests/amdgpu/vce_tests.c b/tests/amdgpu/vce_tests.c index 70e378cd..09e8607c 100644 --- a/tests/amdgpu/vce_tests.c +++ b/tests/amdgpu/vce_tests.c @@ -165,10 +165,11 @@ static int submit(unsigned ndw, unsigned ip) resources[num_resources-1] = ib_handle; fence_status.context = context_handle; - fence_status.timeout_ns = AMDGPU_TIMEOUT_INFINITE; fence_status.ip_type = ip; - r = amdgpu_cs_query_fence_status(&fence_status, &expired); + r = amdgpu_cs_query_fence_status(&fence_status, + AMDGPU_TIMEOUT_INFINITE, + 0, &expired); if (r) return r; |