[PATCH i-g-t v2] tests/kms_async_flips: Replace hard coded modifiers with async modifiers

Karthik B S karthik.b.s at intel.com
Fri Jul 18 08:43:45 UTC 2025


Hi Santhosh,

On 7/16/2025 9:42 PM, Santhosh Reddy Guddati wrote:
> Use the IN_FORMATS_ASYNC uAPI to get the list of async supported modifiers.
> select the 2 unique modifiers from this list to test invalid async test,
> removing the hard coded dependency across platforms.
>
> v2: Use first and last modifier from the async supported format list for
> invalid subtest.
>
> closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/3768
> Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati at intel.com>
> ---
>   tests/kms_async_flips.c | 16 +++++++++-------
>   1 file changed, 9 insertions(+), 7 deletions(-)
>
> diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
> index ddac904ce..1d4684c51 100644
> --- a/tests/kms_async_flips.c
> +++ b/tests/kms_async_flips.c
> @@ -598,6 +598,7 @@ static void test_invalid(data_t *data)
>   	struct igt_fb fb[2];
>   	drmModeModeInfo *mode;
>   	int flags;
> +	uint64_t mod1, mod2;
>   
>   	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
>   
> @@ -607,10 +608,16 @@ static void test_invalid(data_t *data)
>   
>   	flags = DRM_MODE_PAGE_FLIP_ASYNC | DRM_MODE_PAGE_FLIP_EVENT;
>   
> +	mod1 = data->plane->async_modifiers[0];
> +	mod2 = data->plane->async_modifiers[(data->plane->async_format_mod_count) - 1];

Please add a comment mentioning why we're using the first and last 
modifier here.

With this added,

Reviewed-by: Karthik B S <karthik.b.s at intel.com>

> +
> +	igt_info("using modifier1 %s and modifier2 %s\n",
> +		 igt_fb_modifier_name(mod1), igt_fb_modifier_name(mod2));
> +
>   	igt_create_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
> -		      I915_FORMAT_MOD_X_TILED, &fb[0]);
> +		      mod1, &fb[0]);
>   	igt_create_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
> -		      I915_FORMAT_MOD_Y_TILED, &fb[1]);
> +		      mod2, &fb[1]);
>   
>   	igt_plane_set_fb(data->plane, &fb[0]);
>   	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
> @@ -1113,11 +1120,6 @@ igt_main
>   		test_init_ops(&data);
>   		/* TODO: support more vendors */
>   		igt_require(is_intel_device(data.drm_fd));
> -		igt_require(igt_display_has_format_mod(&data.display, DRM_FORMAT_XRGB8888,
> -						       I915_FORMAT_MOD_X_TILED));
> -		igt_require(igt_display_has_format_mod(&data.display, DRM_FORMAT_XRGB8888,
> -						       I915_FORMAT_MOD_Y_TILED));
> -
>   		run_test(&data, test_invalid);
>   	}
>   


More information about the igt-dev mailing list