summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJammy Zhou <Jammy.Zhou@amd.com>2015-05-25 20:38:03 +0800
committerAlex Deucher <alexander.deucher@amd.com>2015-07-30 00:11:11 -0400
commit7e47cbb2a61db8659f3f32efe7933733207a0134 (patch)
treee775083d6ef0fe8d5199149b11423ade5004a5ec
parent830e740ef7668b7b5ac30c95b55d94dc50e72667 (diff)
tests/amdgpu: manage IB in client side
Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com> Reviewed-by: Christian K├Ânig <christian.koenig@amd.com>
-rw-r--r--tests/amdgpu/basic_tests.c15
-rw-r--r--tests/amdgpu/cs_tests.c7
2 files changed, 15 insertions, 7 deletions
diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c
index 67a8d3c6..0ae25d6f 100644
--- a/tests/amdgpu/basic_tests.c
+++ b/tests/amdgpu/basic_tests.c
@@ -210,6 +210,12 @@ static void amdgpu_command_submission_gfx_separate_ibs(void)
r = amdgpu_cs_query_fence_status(&fence_status, &expired);
CU_ASSERT_EQUAL(r, 0);
+ r = amdgpu_cs_free_ib(ib_result.handle);
+ CU_ASSERT_EQUAL(r, 0);
+
+ r = amdgpu_cs_free_ib(ib_result_ce.handle);
+ CU_ASSERT_EQUAL(r, 0);
+
r = amdgpu_cs_ctx_free(context_handle);
CU_ASSERT_EQUAL(r, 0);
}
@@ -266,6 +272,9 @@ static void amdgpu_command_submission_gfx_shared_ib(void)
r = amdgpu_cs_query_fence_status(&fence_status, &expired);
CU_ASSERT_EQUAL(r, 0);
+ r = amdgpu_cs_free_ib(ib_result.handle);
+ CU_ASSERT_EQUAL(r, 0);
+
r = amdgpu_cs_ctx_free(context_handle);
CU_ASSERT_EQUAL(r, 0);
}
@@ -324,6 +333,9 @@ static void amdgpu_command_submission_compute(void)
r = amdgpu_cs_query_fence_status(&fence_status, &expired);
CU_ASSERT_EQUAL(r, 0);
+
+ r = amdgpu_cs_free_ib(ib_result.handle);
+ CU_ASSERT_EQUAL(r, 0);
}
r = amdgpu_cs_ctx_free(context_handle);
@@ -394,6 +406,9 @@ static void amdgpu_sdma_test_exec_cs(amdgpu_context_handle context_handle,
r = amdgpu_cs_query_fence_status(&fence_status, &expired);
CU_ASSERT_EQUAL(r, 0);
CU_ASSERT_EQUAL(expired, true);
+
+ r = amdgpu_cs_free_ib(ib_result.handle);
+ CU_ASSERT_EQUAL(r, 0);
}
static void amdgpu_command_submission_sdma_write_linear(void)
diff --git a/tests/amdgpu/cs_tests.c b/tests/amdgpu/cs_tests.c
index 6d485ae3..5fb11b18 100644
--- a/tests/amdgpu/cs_tests.c
+++ b/tests/amdgpu/cs_tests.c
@@ -133,13 +133,6 @@ static int submit(unsigned ndw, unsigned ip)
if (r)
return r;
- r = amdgpu_cs_alloc_ib(context_handle, IB_SIZE, &ib_result);
- if (r)
- return r;
-
- ib_handle = ib_result.handle;
- ib_cpu = ib_result.cpu;
-
fence_status.context = context_handle;
fence_status.timeout_ns = AMDGPU_TIMEOUT_INFINITE;
fence_status.ip_type = ip;