[PATCH i-g-t] tests/kms_plane_scaling: Improvise the scaling BW issues.

Nautiyal, Ankit K ankit.k.nautiyal at intel.com
Tue Jul 9 04:35:55 UTC 2024


On 7/6/2024 1:28 AM, Naladala Ramanaidu wrote:
> 	Description:
> 	1. We observed many tests are failing due to Bandwidth
> 	   issues. To elimate this failures we change the least
> 	   working modes.

Please mention what is the problem faced and why this change is needed 
to fix this.

Also, lets have a generic solution instead of a solution for a specific 
config.

As I understand some of the tests are failing, as the mode which is used 
seems to require bandwidth that is beyond what can be supported by a config.

So a possible solution would be to try a lower mode from the list of 
modes, instead of just picking 1080p.

Aside from this, I see some styling issues in the patch. Lets adhere to 
coding style: 
https://www.kernel.org/doc/Documentation/process/coding-style.rst

Regards,

Ankit


>
> Signed-off-by: Naladala Ramanaidu <ramanaidu.naladala at intel.com>
> ---
>   tests/kms_plane_scaling.c | 72 ++++++++++++++++++++++++++++++++++++---
>   1 file changed, 67 insertions(+), 5 deletions(-)
>
> diff --git a/tests/kms_plane_scaling.c b/tests/kms_plane_scaling.c
> index 3f63d3cf4..22983710f 100644
> --- a/tests/kms_plane_scaling.c
> +++ b/tests/kms_plane_scaling.c
> @@ -197,6 +197,9 @@
>   
>   IGT_TEST_DESCRIPTION("Test display plane scaling");
>   
> +#define MODE2KHDISPLAY 1920
> +#define MODE2KVDISPLAY 1080
> +
>   enum scaler_combo_test_type {
>   	TEST_PLANES_UPSCALE = 0,
>   	TEST_PLANES_DOWNSCALE,
> @@ -210,6 +213,9 @@ typedef struct {
>   	igt_display_t display;
>   	struct igt_fb fb[4];
>   	bool extended;
> +	double sf_plane1;
> +	double sf_plane2;
> +	bool flag;
>   } data_t;
>   
>   struct invalid_paramtests {
> @@ -579,13 +585,31 @@ static void check_scaling_pipe_plane_rot(data_t *d, igt_plane_t *plane,
>   	drmModeModeInfo *mode;
>   	int commit_ret;
>   	int w, h;
> -
> -	mode = igt_output_get_mode(output);
> +	bool mode_support=false;
>   
>   	if (is_upscale) {
> +		mode = igt_output_get_mode(output);
>   		w = width;
>   		h = height;
>   	} else {
> +		for_each_connector_mode(output) {
> +			mode = &output->config.connector->modes[j__];
> +			if((MODE2KHDISPLAY == mode->hdisplay) && (MODE2KVDISPLAY == mode->vdisplay)) {
> +				mode_support=true;
> +				break;
> +			}
> +
> +		}
> +		igt_skip_on_f(!mode_support, "Unsupported Resolution \n");
> +
> +		igt_output_override_mode(output, mode);
> +		if (d->flag == true) {
> +			width = mode->hdisplay + 100;
> +			height = mode->vdisplay + 100;
> +		}else {
> +			width = get_width(mode, d->sf_plane1);
> +			height = get_height(mode, d->sf_plane1);
> +		}
>   		w = mode->hdisplay;
>   		h = mode->vdisplay;
>   	}
> @@ -593,7 +617,7 @@ static void check_scaling_pipe_plane_rot(data_t *d, igt_plane_t *plane,
>   	/*
>   	 * guarantee even value width/height to avoid fractional
>   	 * uv component in chroma subsampling for yuv 4:2:0 formats
> -	 * */
> +	 */
>   	w = ALIGN(w, 2);
>   	h = ALIGN(h, 2);
>   
> @@ -603,6 +627,10 @@ static void check_scaling_pipe_plane_rot(data_t *d, igt_plane_t *plane,
>   	igt_fb_set_position(&d->fb[0], plane, 0, 0);
>   	igt_fb_set_size(&d->fb[0], plane, w, h);
>   	igt_plane_set_position(plane, 0, 0);
> +	commit_ret = igt_display_try_commit2(display, COMMIT_ATOMIC);
> +	igt_skip_on_f(commit_ret == -ERANGE || commit_ret == -EINVAL,
> +		      "Unsupported resolution parameters  %dx%d\n",
> +		       w,h);
>   
>   	if (is_upscale)
>   		igt_plane_set_size(plane, mode->hdisplay, mode->vdisplay);
> @@ -847,11 +875,27 @@ __test_planes_scaling_combo(data_t *d, int w1, int h1, int w2, int h2,
>   	igt_display_t *display = &d->display;
>   	drmModeModeInfo *mode;
>   	int ret;
> +	bool mode_support=false;
>   
> -	mode = igt_output_get_mode(output);
> +	for_each_connector_mode(output) {
> +		mode = &output->config.connector->modes[j__];
> +		if((MODE2KHDISPLAY == mode->hdisplay) && (MODE2KVDISPLAY == mode->vdisplay)) {
> +			mode_support = true;
> +			break;
> +		}
> +	}
> +	igt_skip_on_f(!mode_support, "Band Width not sufficent for Multi Plane\n");
> +	igt_output_override_mode(output, mode);
> +	w1 = get_width(mode, d->sf_plane1);
> +	h1 = get_height(mode, d->sf_plane1);
> +	w2 = get_width(mode, d->sf_plane2);
> +        h2 = get_height(mode, d->sf_plane2);
>   
>   	igt_plane_set_fb(p1, fb1);
>   	igt_plane_set_fb(p2, fb2);
> +	ret = igt_display_try_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);
> +	igt_skip_on_f(ret == -EINVAL || ret == -ERANGE,
> +                      "Resolution not supported by driver\n");
>   
>   	switch (test_type) {
>   	case TEST_PLANES_UPSCALE:
> @@ -904,7 +948,17 @@ test_planes_scaling_combo(data_t *d, int w1, int h1, int w2, int h2,
>   	cleanup_crtc(d);
>   
>   	igt_output_set_pipe(output, pipe);
> -	mode = igt_output_get_mode(output);
> +	for_each_connector_mode(output) {
> +		mode = &output->config.connector->modes[j__];
> +		if((MODE2KHDISPLAY == mode->hdisplay) && (MODE2KVDISPLAY == mode->vdisplay))
> +			break;
> +	}
> +
> +	igt_output_override_mode(output, mode);
> +	w1 = get_width(mode, d->sf_plane1);
> +	h1 = get_height(mode, d->sf_plane1);
> +	w2 = get_width(mode, d->sf_plane2);
> +        h2 = get_height(mode, d->sf_plane2);
>   
>   	n_planes = display->pipes[pipe].n_planes;
>   	igt_require(n_planes >= 2);
> @@ -1308,6 +1362,7 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
>   
>   						igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
>   							drmModeModeInfo *mode = igt_output_get_mode(output);
> +							data.sf_plane1 = scaler_with_pixel_format_tests[index].sf;
>   
>   							test_scaler_with_pixel_format_pipe(&data,
>   								get_width(mode, scaler_with_pixel_format_tests[index].sf),
> @@ -1333,6 +1388,7 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
>   
>   						igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
>   							drmModeModeInfo *mode = igt_output_get_mode(output);
> +							data.sf_plane1 = scaler_with_rotation_tests[index].sf;
>   
>   							test_scaler_with_rotation_pipe(&data,
>   								get_width(mode, scaler_with_rotation_tests[index].sf),
> @@ -1358,6 +1414,7 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
>   
>   						igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
>   							drmModeModeInfo *mode = igt_output_get_mode(output);
> +							data.sf_plane1 = scaler_with_modifiers_tests[index].sf;
>   
>   							test_scaler_with_modifier_pipe(&data,
>   								get_width(mode, scaler_with_modifiers_tests[index].sf),
> @@ -1382,6 +1439,7 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
>   
>   					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
>   						drmModeModeInfo *mode = igt_output_get_mode(output);
> +						data.flag =true;
>   
>   						test_scaler_with_pixel_format_pipe(&data, mode->hdisplay + 100,
>   							mode->vdisplay + 100, false, pipe, output);
> @@ -1402,6 +1460,7 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
>   
>   					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
>   						drmModeModeInfo *mode = igt_output_get_mode(output);
> +						data.flag = true;
>   
>   						test_scaler_with_rotation_pipe(&data, mode->hdisplay + 100,
>   							mode->vdisplay + 100, false, pipe, output);
> @@ -1422,6 +1481,7 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
>   
>   					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
>   						drmModeModeInfo *mode = igt_output_get_mode(output);
> +						data.flag=true;
>   						test_scaler_with_modifier_pipe(&data, mode->hdisplay + 100,
>   							mode->vdisplay + 100, false, pipe, output);
>   					}
> @@ -1442,6 +1502,8 @@ igt_main_args("", long_opts, help_str, opt_handler, &data)
>   
>   					igt_dynamic_f("pipe-%s-%s", kmstest_pipe_name(pipe), igt_output_name(output)) {
>   						drmModeModeInfo *mode = igt_output_get_mode(output);
> +						data.sf_plane1 = scaler_with_2_planes_tests[index].sf_plane1;
> +						data.sf_plane2 = scaler_with_2_planes_tests[index].sf_plane2;
>   
>   						test_planes_scaling_combo(&data,
>   							get_width(mode, scaler_with_2_planes_tests[index].sf_plane1),


More information about the igt-dev mailing list