[igt-dev] [PATCH i-g-t] tests/i915/kms_dsc: add extended flag

Kamil Konieczny kamil.konieczny at linux.intel.com
Wed May 24 18:16:25 UTC 2023


Hi Swati,

On 2023-05-24 at 14:39:54 +0530, Swati Sharma wrote:
> Add extended flag to limit test execution to one valid pipe-output
----- ^ -------------- ^
Confusing name, see below.

> combination. By default all tests will run on all valid pipe-output
> combinations.
> 
> Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
> ---
>  tests/i915/kms_dsc.c | 25 +++++++++++++++++++++++--
>  1 file changed, 23 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
> index 3ce28f84..b40bcf47 100644
> --- a/tests/i915/kms_dsc.c
> +++ b/tests/i915/kms_dsc.c
> @@ -51,6 +51,7 @@ typedef struct {
>  	int input_bpc;
>  	int disp_ver;
>  	enum pipe pipe;
> +	bool extended;
>  } data_t;
>  
>  static int output_format_list[] = {DSC_FORMAT_YCBCR420, DSC_FORMAT_YCBCR444};
> @@ -250,13 +251,33 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
>  
>  		igt_dynamic_f("pipe-%s-%s%s",  kmstest_pipe_name(data->pipe), data->output->name, name)
>  			update_display(data, test_type);
> +
> +		if (data->extended)
------------------------- ^
This name is confusing, maybe: only_once ? run_once_only ?

Regards,
Kamil

> +			break;
>  	}
>  }
>  
> -igt_main
> +static int opt_handler(int opt, int opt_index, void *_data)
>  {
> -	data_t data = {};
> +	data_t *data = _data;
>  
> +	switch (opt) {
> +	case 'e':
> +		data->extended = true;
> +		break;
> +	}
> +
> +	return IGT_OPT_HANDLER_SUCCESS;
> +}
> +
> +/* Limit execution to 1 valid pipe-output combo */
> +static const char help_str[] =
> +	"  --extended";
> +
> +static data_t data = {};
> +
> +igt_main_args("e", NULL, help_str, opt_handler, &data)
> +{
>  	igt_fixture {
>  		data.drm_fd = drm_open_driver_master(DRIVER_INTEL | DRIVER_XE);
>  		data.devid = intel_get_drm_devid(data.drm_fd);
> -- 
> 2.25.1
> 


More information about the igt-dev mailing list