tests/amdgpu: add test to submit a gfx command with secure context
authorAaron Liu <aaron.liu@amd.com>
Thu, 14 Nov 2019 08:36:53 +0000 (16:36 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 15 Oct 2020 17:46:29 +0000 (13:46 -0400)
This patch is to test the command submission with secure context.

Acked-by: Huang Rui <ray.huang@amd.com>
Acked-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
Acked-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
tests/amdgpu/security_tests.c

index a3807ee..0bb4ad2 100644 (file)
@@ -32,6 +32,7 @@ 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);
 
 CU_BOOL suite_security_tests_enable(void)
 {
@@ -75,6 +76,7 @@ int suite_security_tests_clean(void)
 
 CU_TestInfo security_tests[] = {
        { "allocate secure buffer test", amdgpu_security_alloc_buf_test },
+       { "graphics secure command submission", amdgpu_security_gfx_submission_test },
        CU_TEST_INFO_NULL,
 };
 
@@ -113,3 +115,10 @@ static void amdgpu_security_alloc_buf_test(void)
        r = gpu_mem_free(bo, va_handle, bo_mc, 4096);
        CU_ASSERT_EQUAL(r, 0);
 }
+
+static void amdgpu_security_gfx_submission_test(void)
+{
+       amdgpu_command_submission_write_linear_helper_with_secure(device_handle,
+                                                                 AMDGPU_HW_IP_GFX,
+                                                                 true);
+}