From: Huang Rui <[email protected]>

This patch is to add secure buffer allocation test for system memory.

Signed-off-by: Huang Rui <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
---
 tests/amdgpu/security_tests.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/amdgpu/security_tests.c b/tests/amdgpu/security_tests.c
index 182b03d..afe79e5 100644
--- a/tests/amdgpu/security_tests.c
+++ b/tests/amdgpu/security_tests.c
@@ -93,4 +93,13 @@ static void amdgpu_security_alloc_buf_test(void)
 
        r = gpu_mem_free(bo, va_handle, bo_mc, 4096);
        CU_ASSERT_EQUAL(r, 0);
+
+       /* Test secure buffer allocation in system memory */
+       bo = gpu_mem_alloc(device_handle, 4096, 4096,
+                          AMDGPU_GEM_DOMAIN_GTT,
+                          AMDGPU_GEM_CREATE_ENCRYPTED,
+                          &bo_mc, &va_handle);
+
+       r = gpu_mem_free(bo, va_handle, bo_mc, 4096);
+       CU_ASSERT_EQUAL(r, 0);
 }
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to