[PATCH i-g-t 3/4] tests/intel/kms_dsc_helper: Add helper func()

Nautiyal, Ankit K ankit.k.nautiyal at intel.com
Wed Mar 12 08:46:03 UTC 2025


On 1/8/2025 12:27 AM, Swati Sharma wrote:
> Add (big|ultra) joiner helper functions.

Need to mention what the helper functions will do.


>
> Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
> ---
>   tests/intel/kms_dsc_helper.c | 46 ++++++++++++++++++++++++++++++++++++
>   tests/intel/kms_dsc_helper.h |  2 ++
>   2 files changed, 48 insertions(+)
>
> diff --git a/tests/intel/kms_dsc_helper.c b/tests/intel/kms_dsc_helper.c
> index cea4304e4..8543498a7 100644
> --- a/tests/intel/kms_dsc_helper.c
> +++ b/tests/intel/kms_dsc_helper.c
> @@ -201,3 +201,49 @@ bool is_dsc_fractional_bpp_supported(int disp_ver, int drmfd, igt_output_t *outp
>   
>   	return true;
>   }
> +
> +bool check_bigjoiner_constraints(int disp_ver, int n_pipes, int drmfd, igt_output_t *output)

disp_ver is unused.


> +{
> +	if (!igt_is_bigjoiner_supported_by_source(drmfd))
> +		return false;
> +
> +	if (n_pipes < 2) {
Can use JOINED_PIPES_BIG_JOINER here instead of hard coding.
> +		igt_info("Bigjoiner requires minimum 2 pipes\n");
> +		return false;
> +	}
> +
> +	if (igt_get_dsc_sink_max_slice_count(drmfd, output->name) < 4) {
This can be again based on the above 2* JOINED_PIPES_BIG_JOINER with an 
explanation that for joiner, 2 slices per pipe is used.
> +		igt_info("Output %s doesn't support minimum 4 slice count\n", igt_output_name(output));
> +		return false;
> +	}
> +
> +	if (!igt_has_force_joiner_debugfs(drmfd, output->name)) {
> +		igt_info("Output %s doesn't support force_joiner debugfs\n", igt_output_name(output));
> +		return false;
> +	}
> +
> +	return true;
> +}
> +
> +bool check_ultrajoiner_constraints(int disp_ver, int n_pipes, int drmfd, igt_output_t *output)
> +{
> +	if (!igt_is_ultrajoiner_supported_by_source(drmfd))
> +		return false;
> +
> +	if (n_pipes < 4) {
Can use JOINED_PIPES_ULTRA_JOINER here.
> +		igt_info("Ultrajoiner requires minimum 4 pipes\n");
> +		return false;
> +	}
> +
> +	if (igt_get_dsc_sink_max_slice_count(drmfd, output->name) < 8) {

Same as above.

I think there can be a common function something like:

static bool check_dsc_joiner_constraints(int num_pipes,  const char 
*joiner_type)

the min_pipes and min_dsc_slices can be derived based on joiner_type 
"Bigjoiner" or "Ultrajoiner"

and so on.

the helpers can call:

check_dsc_joiner_constraints(num_pipes,  "Bigjoiner");

or

check_dsc_joiner_constraints(num_pipes,  "Ultrajoiner");


> +		igt_info("Output %s doesn't support minimum 8 slice count\n", igt_output_name(output));
> +		return false;
> +	}
> +
> +	if (!igt_has_force_joiner_debugfs(drmfd, output->name)) {
> +		igt_info("Output %s doesn't support force_joiner debugfs\n", igt_output_name(output));
> +		return false;
> +	}
> +
> +	return true;
> +}
> diff --git a/tests/intel/kms_dsc_helper.h b/tests/intel/kms_dsc_helper.h
> index 4dbd88fe7..a24696640 100644
> --- a/tests/intel/kms_dsc_helper.h
> +++ b/tests/intel/kms_dsc_helper.h
> @@ -38,5 +38,7 @@ void force_dsc_fractional_bpp_enable(int drmfd, igt_output_t *output);
>   void save_force_dsc_fractional_bpp_en(int drmfd, igt_output_t *output);
>   void restore_force_dsc_fractional_bpp_en(void);
>   bool is_dsc_fractional_bpp_supported(int disp_ver, int drmfd, igt_output_t *output);
> +bool check_bigjoiner_constraints(int disp_ver, int n_pipes, int drmfd, igt_output_t *output);
> +bool check_ultrajoiner_constraints(int disp_ver, int n_pipes, int drmfd, igt_output_t *output);

The names should have 'dsc' to signify that these are the constraints 
when dsc is required/forced.


Regards,

Ankit

>   
>   #endif


More information about the igt-dev mailing list