[igt-dev] [PATCH] tests/kms_atomic_transition: Address test flakiness

Juha-Pekka Heikkila juhapekka.heikkila at gmail.com
Thu Sep 7 18:56:19 UTC 2023


Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>

On 28.8.2023 23.23, Drew Davenport wrote:
> Nonblocking commits can sometimes return -EBUSY. It's expected that
> this error is transient and that userspace should retry the commit.
> 
> Since kms_atomic_transition uses nonblocking commits for some test
> cases, the test fails flakily.
> 
> This change will handle -EBUSY to ensure that the test does not
> fail in that case.
> 
> Closes: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/144
> Signed-off-by: Drew Davenport <ddavenport at chromium.org>
> 
> ---
> 
>   tests/kms_atomic_transition.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/kms_atomic_transition.c b/tests/kms_atomic_transition.c
> index 6ab5267ca..46ce9f929 100644
> --- a/tests/kms_atomic_transition.c
> +++ b/tests/kms_atomic_transition.c
> @@ -683,7 +683,11 @@ static void commit_display(data_t *data, unsigned event_mask, bool nonblocking)
>   	if (nonblocking)
>   		flags |= DRM_MODE_ATOMIC_NONBLOCK;
>   
> -	igt_display_commit_atomic(&data->display, flags, NULL);
> +	do {
> +		ret = igt_display_try_commit_atomic(&data->display, flags, NULL);
> +	} while (ret == -EBUSY);
> +
> +	igt_assert_eq(ret, 0);
>   
>   	igt_debug("Event mask: %x, waiting for %i events\n", event_mask, num_events);
>   



More information about the igt-dev mailing list