[PATCH 10/12] tests/amdgpu: add test to submit a gfx command with secure context

Huang, Ray Ray.Huang at amd.com
Fri Nov 15 10:06:49 UTC 2019


On Fri, Nov 15, 2019 at 11:34:53AM +0800, Liu, Aaron wrote:
> This patch is to test the command submission with secure context.
> 
> Signed-off-by: Aaron Liu <aaron.liu at amd.com>

Reviewed-by: Huang Rui <ray.huang at amd.com>

> ---
>  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 a3807ee..0bb4ad2 100644
> --- a/tests/amdgpu/security_tests.c
> +++ b/tests/amdgpu/security_tests.c
> @@ -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);
> +}
> -- 
> 2.7.4
> 


More information about the amd-gfx mailing list