summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuben Tuikov <luben.tuikov@amd.com>2020-05-21 15:32:08 -0400
committerAlex Deucher <alexander.deucher@amd.com>2020-10-15 13:46:55 -0400
commit18a0291273ad8eca67830a941748fd511fe484be (patch)
tree9107d459e32d2139ad8982063201b9bb95a41c29
parent24b9c9ca47e6000fa60e6ad282b2bf1703a69cb6 (diff)
downloadlibdrm-18a0291273ad8eca67830a941748fd511fe484be.tar.gz
libdrm-18a0291273ad8eca67830a941748fd511fe484be.tar.bz2
libdrm-18a0291273ad8eca67830a941748fd511fe484be.zip
tests/amdgpu: Remove forward declarations
Acked-by: Huang Rui <ray.huang@amd.com> Acked-by: Leo Liu <leo.liu@amd.com> Signed-off-by: Luben Tuikov <luben.tuikov@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--tests/amdgpu/security_tests.c116
1 files changed, 56 insertions, 60 deletions
diff --git a/tests/amdgpu/security_tests.c b/tests/amdgpu/security_tests.c
index cc7c24e3..87123efa 100644
--- a/tests/amdgpu/security_tests.c
+++ b/tests/amdgpu/security_tests.c
@@ -31,66 +31,6 @@ static amdgpu_device_handle device_handle;
static uint32_t major_version;
static uint32_t minor_version;
-static void amdgpu_security_alloc_buf_test(void);
-static void amdgpu_security_gfx_submission_test(void);
-static void amdgpu_security_sdma_submission_test(void);
-
-
-CU_BOOL suite_security_tests_enable(void)
-{
- CU_BOOL enable = CU_TRUE;
-
- if (amdgpu_device_initialize(drm_amdgpu[0], &major_version,
- &minor_version, &device_handle))
- return CU_FALSE;
-
- if (device_handle->info.family_id < AMDGPU_FAMILY_RV) {
- printf("\n\nDon't support TMZ (trust memory zone), security suite disabled\n");
- enable = CU_FALSE;
- }
-
- if ((major_version < 3) ||
- ((major_version == 3) && (minor_version < 37))) {
- printf("\n\nDon't support TMZ (trust memory zone), kernel DRM version (%d.%d)\n",
- major_version, minor_version);
- printf("is older, security suite disabled\n");
- enable = CU_FALSE;
- }
-
- if (amdgpu_device_deinitialize(device_handle))
- return CU_FALSE;
-
- return enable;
-}
-
-int suite_security_tests_init(void)
-{
- if (amdgpu_device_initialize(drm_amdgpu[0], &major_version,
- &minor_version, &device_handle))
- return CUE_SINIT_FAILED;
-
- return CUE_SUCCESS;
-}
-
-int suite_security_tests_clean(void)
-{
- int r;
-
- r = amdgpu_device_deinitialize(device_handle);
- if (r)
- return CUE_SCLEAN_FAILED;
-
- return CUE_SUCCESS;
-}
-
-
-CU_TestInfo security_tests[] = {
- { "allocate secure buffer test", amdgpu_security_alloc_buf_test },
- { "graphics secure command submission", amdgpu_security_gfx_submission_test },
- { "sdma secure command submission", amdgpu_security_sdma_submission_test },
- CU_TEST_INFO_NULL,
-};
-
static void amdgpu_security_alloc_buf_test(void)
{
amdgpu_bo_handle bo;
@@ -140,3 +80,59 @@ static void amdgpu_security_sdma_submission_test(void)
AMDGPU_HW_IP_DMA,
true);
}
+
+/* ----------------------------------------------------------------- */
+
+CU_TestInfo security_tests[] = {
+ { "allocate secure buffer test", amdgpu_security_alloc_buf_test },
+ { "graphics secure command submission", amdgpu_security_gfx_submission_test },
+ { "sdma secure command submission", amdgpu_security_sdma_submission_test },
+ CU_TEST_INFO_NULL,
+};
+
+CU_BOOL suite_security_tests_enable(void)
+{
+ CU_BOOL enable = CU_TRUE;
+
+ if (amdgpu_device_initialize(drm_amdgpu[0], &major_version,
+ &minor_version, &device_handle))
+ return CU_FALSE;
+
+ if (device_handle->info.family_id < AMDGPU_FAMILY_RV) {
+ printf("\n\nDon't support TMZ (trust memory zone), security suite disabled\n");
+ enable = CU_FALSE;
+ }
+
+ if ((major_version < 3) ||
+ ((major_version == 3) && (minor_version < 37))) {
+ printf("\n\nDon't support TMZ (trust memory zone), kernel DRM version (%d.%d)\n",
+ major_version, minor_version);
+ printf("is older, security suite disabled\n");
+ enable = CU_FALSE;
+ }
+
+ if (amdgpu_device_deinitialize(device_handle))
+ return CU_FALSE;
+
+ return enable;
+}
+
+int suite_security_tests_init(void)
+{
+ if (amdgpu_device_initialize(drm_amdgpu[0], &major_version,
+ &minor_version, &device_handle))
+ return CUE_SINIT_FAILED;
+
+ return CUE_SUCCESS;
+}
+
+int suite_security_tests_clean(void)
+{
+ int r;
+
+ r = amdgpu_device_deinitialize(device_handle);
+ if (r)
+ return CUE_SCLEAN_FAILED;
+
+ return CUE_SUCCESS;
+}