[PATCH i-g-t] tests/intel/kms_big_fb: Introducing this restriction to optimize the test execution time on simulation

Kamil Konieczny kamil.konieczny at linux.intel.com
Thu May 16 08:03:25 UTC 2024


Hi Pranay,
On 2024-05-16 at 09:46:10 +0530, Pranay Samala wrote:
> This test executes on all the availble planes and set of 6 coordinates.
> Due to this, test takes long duration to executes on simulation and
> gets timeout.

This is why part, write also how you solved that problem.

> 
> Signed-off-by: Pranay Samala <pranay.samala at intel.com>
> ---
>  tests/intel/kms_big_fb.c | 22 +++++++++++++++++-----
>  1 file changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/intel/kms_big_fb.c b/tests/intel/kms_big_fb.c
> index 1e45d8e42..a26465b67 100644
> --- a/tests/intel/kms_big_fb.c
> +++ b/tests/intel/kms_big_fb.c
> @@ -443,18 +443,26 @@ static bool test_plane(data_t *data)
>  	struct igt_fb *big_fb = &data->big_fb;
>  	int w = data->big_fb_width - small_fb->width;
>  	int h = data->big_fb_height - small_fb->height;
> +	int m;

Make it more descriptive, 'm' looks a little too short.

>  	struct {
>  		int x, y;
>  	} coords[] = {
>  		/* bunch of coordinates pulled out of thin air */
> +		{ w, h, },
>  		{ 0, 0, },
>  		{ w * 4 / 7, h / 5, },
>  		{ w * 3 / 7, h / 3, },
>  		{ w / 2, h / 2, },
>  		{ w / 3, h * 3 / 4, },
> -		{ w, h, },

Why you did this? This is a change in what is tested first and
it is not reflected in test name (I may be wrong here).
Btw why not testing also 0,0 in simulation?

>  	};
>  
> +	if (igt_run_in_simulation()) {
> +		m = 1;
> +		plane = igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY);
> +		igt_plane_set_fb(plane, NULL);

What about pipe?

> +	} else
> +		m = ARRAY_SIZE(coords);
> +
>  	if (!igt_plane_has_format_mod(plane, data->format, data->modifier))
>  		return false;
>  
> @@ -465,7 +473,7 @@ static bool test_plane(data_t *data)
>  		igt_plane_set_rotation(plane, data->rotation);
>  	igt_plane_set_position(plane, 0, 0);
>  
> -	for (int i = 0; i < ARRAY_SIZE(coords); i++) {
> +	for (int i = 0; i < m; i++) {

You could just do a break here if in simulation and i > 0 or i > 1
or on some other conditions.

Regards,
Kamil

>  		igt_crc_t small_crc, big_crc;
>  		int x = coords[i].x;
>  		int y = coords[i].y;
> @@ -595,10 +603,14 @@ static bool test_pipe(data_t *data)
>  	data->pipe_crc = igt_pipe_crc_new(data->drm_fd, data->pipe,
>  					  IGT_PIPE_CRC_SOURCE_AUTO);
>  
> -	for_each_plane_on_pipe(&data->display, data->pipe, data->plane) {
> +	if (igt_run_in_simulation())
>  		ret = test_plane(data);
> -		if (ret)
> -			break;
> +	else {
> +		for_each_plane_on_pipe(&data->display, data->pipe, data->plane) {
> +			ret = test_plane(data);
> +			if (ret)
> +				break;
> +		}
>  	}
>  
>  	if (data->format == DRM_FORMAT_C8)
> -- 
> 2.34.1
> 


More information about the igt-dev mailing list