[PATCH] amdgpu/tests: Fix vce enc test failure

Christian König christian.koenig at amd.com
Tue Mar 5 09:14:13 UTC 2024


Am 04.03.24 um 22:16 schrieb vitaly.prosyak at amd.com:
> From: Vitaly Prosyak <vitaly.prosyak at amd.com>
>
> Combine the following sub-tests: creation, encoding
> and destroy as a single sub-test for vce encoder.
> It is a similar change as commit 40ed74461d8a44657a0f4799ade86116722d3ea2.
>
> Cc: Christian Koenig <christian.koenig at amd.com>
> Cc: Alex Deucher <alexander.deucher at amd.com>
> Cc: Michael Strawbridge <michael.strawbridge at amd.com>
> Cc: Kamil Konieczny <kamil.konieczny at linux.intel.com>
> Cc: Petri Latvala <adrinael at adrinael.net>
> Signed-off-by: Michael Strawbridge <michael.strawbridge at amd.com>
> Signed-off-by: Vitaly Prosyak <vitaly.prosyak at amd.com>

Acked-by: Christian König <christian.koenig at amd.com>

> ---
>   tests/amdgpu/amd_vce_dec.c | 32 ++++++++++++++------------------
>   1 file changed, 14 insertions(+), 18 deletions(-)
>
> diff --git a/tests/amdgpu/amd_vce_dec.c b/tests/amdgpu/amd_vce_dec.c
> index 364534955..51902802c 100644
> --- a/tests/amdgpu/amd_vce_dec.c
> +++ b/tests/amdgpu/amd_vce_dec.c
> @@ -552,6 +552,17 @@ amdgpu_cs_vce_destroy(amdgpu_device_handle device_handle, struct mmd_context *co
>   	free_resource(&enc->fb[0]);
>   }
>   
> +static void
> +amdgpu_vce_enc_test(amdgpu_device_handle device, struct mmd_context *context,
> +		struct amdgpu_vce_encode *enc, bool is_mv_supported)
> +{
> +	amdgpu_cs_vce_create(device, enc, context, is_mv_supported);
> +	amdgpu_cs_vce_encode(device, context, enc, is_mv_supported);
> +	if (is_mv_supported)
> +		amdgpu_cs_vce_encode_mv(device, context, enc, is_mv_supported);
> +	amdgpu_cs_vce_destroy(device, &context, &enc);
> +}
> +
>   igt_main
>   {
>   	amdgpu_device_handle device;
> @@ -574,24 +585,9 @@ igt_main
>   		igt_skip_on(!is_vce_tests_enable(device, context.family_id, context.chip_id,
>   				context.chip_rev, &is_mv_supported));
>   	}
> -	igt_describe("Test whether vce enc is created");
> -	igt_subtest("amdgpu_cs_vce_create")
> -	amdgpu_cs_vce_create(device, &enc, &context, is_mv_supported);
> -
> -	igt_describe("Test whether vce enc encodes");
> -	igt_subtest("amdgpu_cs_vce_encode")
> -	amdgpu_cs_vce_encode(device, &context, &enc,  is_mv_supported);
> -
> -	if (is_mv_supported) {
> -		igt_describe("Test whether vce enc encodes mv");
> -		igt_subtest("amdgpu_cs_vce_encode_mv")
> -		amdgpu_cs_vce_encode_mv(device, &context, &enc, is_mv_supported);
> -	}
> -
> -	igt_describe("Test whether vce enc is destroyed");
> -	igt_subtest("amdgpu_cs_vce_destroy")
> -	amdgpu_cs_vce_destroy(device, &context, &enc);
> -
> +	igt_describe("Test vce enc is created, encode, destroy");
> +	igt_subtest("amdgpu_vce_encoder")
> +		amdgpu_vce_enc_test(device, &context, &enc, is_mv_supported);
>   
>   	igt_fixture {
>   		mmd_context_clean(device, &context);



More information about the igt-dev mailing list