[PATCH libdrm] amdgpu: make userptr unit test more interesting

Deucher, Alexander Alexander.Deucher at amd.com
Mon Sep 11 14:34:12 UTC 2017


> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces at lists.freedesktop.org] On Behalf
> Of Christian König
> Sent: Thursday, September 07, 2017 4:17 AM
> To: amd-gfx at lists.freedesktop.org
> Subject: [PATCH libdrm] amdgpu: make userptr unit test more interesting
> 
> From: Christian König <christian.koenig at amd.com>
> 
> Do a fork() to force some MMU callbacks.
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>

Acked-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  tests/amdgpu/basic_tests.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c
> index 80d15e7..18bcf91 100644
> --- a/tests/amdgpu/basic_tests.c
> +++ b/tests/amdgpu/basic_tests.c
> @@ -31,6 +31,7 @@
>  #ifdef HAVE_ALLOCA_H
>  # include <alloca.h>
>  #endif
> +#include <sys/wait.h>
> 
>  #include "CUnit/Basic.h"
> 
> @@ -1403,6 +1404,11 @@ static void amdgpu_userptr_test(void)
>  	while (j++ < sdma_write_length)
>  		pm4[i++] = 0xdeadbeaf;
> 
> +	if (!fork()) {
> +		pm4[0] = 0x0;
> +		exit(0);
> +	}
> +
>  	amdgpu_test_exec_cs_helper(context_handle,
>  				   AMDGPU_HW_IP_DMA, 0,
>  				   i, pm4,
> @@ -1426,4 +1432,6 @@ static void amdgpu_userptr_test(void)
> 
>  	r = amdgpu_cs_ctx_free(context_handle);
>  	CU_ASSERT_EQUAL(r, 0);
> +
> +	wait(NULL);
>  }
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list