[PATCH i-g-t 1/2] tests/kms_feature_discovery: make display test dynamic

B, Jeevan jeevan.b at intel.com
Mon Feb 5 07:58:23 UTC 2024


LGTM 

Reviewed-by: Jeevan B <jeevan.b at intel.com>

> -----Original Message-----
> From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Kunal
> Joshi
> Sent: Tuesday, January 30, 2024 11:08 AM
> To: igt-dev at lists.freedesktop.org
> Cc: Joshi, Kunal1 <kunal1.joshi at intel.com>
> Subject: [PATCH i-g-t 1/2] tests/kms_feature_discovery: make display test
> dynamic
> 
> currently kms_feature_discovery at display checks for number of display from 1
> to 4, make it dynamic to check from 1 to n also reducing unwanted skips.
> 
> anyone who needs to check number of displays for a particular config can
> check kms_feature_discovery at display test result.
> 
> v2: skip if 0 outputs
>     test name fix
> 
> Signed-off-by: Kunal Joshi <kunal1.joshi at intel.com>
> ---
>  tests/kms_feature_discovery.c | 36 +++++++----------------------------
>  1 file changed, 7 insertions(+), 29 deletions(-)
> 
> diff --git a/tests/kms_feature_discovery.c b/tests/kms_feature_discovery.c
> index 5bca9ad76..2dd4efea4 100644
> --- a/tests/kms_feature_discovery.c
> +++ b/tests/kms_feature_discovery.c
> @@ -47,10 +47,6 @@
>   * SUBTEST: display
>   * Description: Make sure that we have display support.
>   *
> - * SUBTEST: display-%dx
> - * Description: Make sure that we have display support with %arg[1]
> - * 		outputs connected.
> - *
>   * SUBTEST: chamelium
>   * Description: Make sure that Chamelium is configured and reachable.
>   * Functionality: feature_discovery, chamelium @@ -69,8 +65,6 @@
>   * Description: Make sure that we have DP-MST configuration.
>   * Functionality: feature_discovery, mst
>   * Test category: functionality test
> - *
> - * arg[1].values: 1, 2, 3, 4
>   */
> 
>  static igt_display_t display;
> @@ -92,11 +86,6 @@ igt_main {
>  			igt_display_require(&display, fd);
>  		}
> 
> -		igt_describe("Make sure that we have display support.");
> -		igt_subtest("display") {
> -			/* will skip because of the fixture */
> -		}
> -
>  		igt_subtest_group {
>  			volatile int output_count = 0;
>  			igt_output_t *output;
> @@ -117,26 +106,15 @@ igt_main {
>  				for (int i = 0; i < display.n_outputs; i++) {
> 
> 	igt_output_set_pipe(&display.outputs[i], PIPE_NONE);
>  				}
> +				igt_require_f(output_count >= 0, "No
> display's connected\n");
>  			}
> 
> -			igt_describe("Make sure that we can use at least 1
> output at the same time.");
> -			igt_subtest("display-1x") {
> -				igt_require(output_count >= 1);
> -			}
> -
> -			igt_describe("Make sure that we can use at least 2
> outputs at the same time.");
> -			igt_subtest("display-2x") {
> -				igt_require(output_count >= 2);
> -			}
> -
> -			igt_describe("Make sure that we can use at least 3
> outputs at the same time.");
> -			igt_subtest("display-3x") {
> -				igt_require(output_count >= 3);
> -			}
> -
> -			igt_describe("Make sure that we can use at least 4
> outputs at the same time.");
> -			igt_subtest("display-4x") {
> -				igt_require(output_count >= 4);
> +			igt_describe("Make sure that we can use at least n
> output at the same time.");
> +			igt_subtest_with_dynamic("display") {
> +				int i;
> +				for(i = 1; i <= output_count; i++)
> +					igt_dynamic_f("%dx", i)
> +						igt_require(output_count >=
> i);
>  			}
>  		}
> 
> --
> 2.25.1



More information about the igt-dev mailing list