igt-dev.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Karthik B S <karthik.b.s@intel.com>
To: Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	<igt-dev@lists.freedesktop.org>,
	<santhosh.reddy.guddati@intel.com>, Jeevan B <jeevan.b@intel.com>
Subject: Re: [PATCH i-g-t v3 2/2] tests/intel/kms_joiner: Add function for pretest checks
Date: Mon, 15 Dec 2025 14:23:44 +0530	[thread overview]
Message-ID: <b1a54ed1-ff37-4b7b-b11e-b7fb28aa1ece@intel.com> (raw)
In-Reply-To: <20251212123216.ewyroutl4gx4wrcl@kamilkon-DESK.igk.intel.com>

Hi Kamil,

On 12/12/2025 6:02 PM, Kamil Konieczny wrote:
> Hi Karthik,
> On 2025-12-12 at 11:27:16 +0530, Karthik B S wrote:
>> Move igt_require checks in individual subtests to a function which is
>> called from all subtests to avoid code duplication.
>>
>> v2: Use enum for various joiner modes (Santhosh)
>>
>> v3: Split the function for big and ultra joiner (Kamil)
>>      Use igt_require_f (Kamil)
>>      Minor Styling cleanups
>>
> +cc Jeevan B <jeevan.b@intel.com>
>
>> Signed-off-by: Karthik B S <karthik.b.s@intel.com>
>> ---
>>   tests/intel/kms_joiner.c | 98 +++++++++++++++++++++-------------------
>>   1 file changed, 52 insertions(+), 46 deletions(-)
>>
>> diff --git a/tests/intel/kms_joiner.c b/tests/intel/kms_joiner.c
>> index f8e684b47..ed82f4789 100644
>> --- a/tests/intel/kms_joiner.c
>> +++ b/tests/intel/kms_joiner.c
>> @@ -101,10 +101,16 @@ typedef struct {
>>   	igt_output_t *non_joiner_output[IGT_MAX_PIPES];
>>   	enum pipe pipe_seq[IGT_MAX_PIPES];
>>   	igt_display_t display;
>> +	bool ultra_joiner_supported;
>>   } data_t;
>>   
>>   static int max_dotclock;
>>   
>> +enum force_mode {
>> +	FORCE_ENABLE = 0,
>> +	FORCE_DISABLE
>> +};
>> +
>>   static void enable_force_joiner_on_all_non_big_joiner_outputs(data_t *data)
>>   {
>>   	bool status;
>> @@ -179,6 +185,32 @@ static void set_joiner_mode(data_t *data, igt_output_t *output, drmModeModeInfo
>>   	igt_remove_fb(data->drm_fd, &fb);
>>   }
>>   
>> +static void require_ultra_joiner(data_t *data, enum force_mode mode)
>> +{
>> +	igt_require_f(data->ultra_joiner_supported,
>> +		      "Ultra joiner not supported on this platform\n");
>> +	igt_require_f(data->n_pipes >= 4, "Minimum 4 pipes required\n");
>> +
>> +	if (mode == FORCE_ENABLE)
>> +		igt_require_f(data->non_ultra_joiner_output_count > 0,
>> +			      "No non ultra joiner output found\n");
>> +	else
>> +		igt_require_f(data->ultra_joiner_output_count > 0,
>> +			      "No ultra joiner output found\n");
>> +}
>> +
>> +static void require_big_joiner(data_t *data, enum force_mode mode)
>> +{
>> +	igt_require_f(data->n_pipes >= 2, "Minimum 2 pipes required\n");
>> +
>> +	if (mode == FORCE_ENABLE)
>> +		igt_require_f(data->non_ultra_joiner_output_count > 0,
> Should this be:
> 		igt_require_f(data->non_big_joiner_output_count > 0,

Thanks for the catch. Will fix this in next rev.

Regards,
Karthik.B.S
>
> Regards,
> Kamil
>
>> +			      "No non big joiner output found\n");
>> +	else
>> +		igt_require_f(data->big_joiner_output_count > 0,
>> +			      "No big joiner output found\n");
>> +}
>> +
>>   static void switch_modeset_ultra_joiner_big_joiner(data_t *data, igt_output_t *output)
>>   {
>>   	drmModeModeInfo bj_mode;
>> @@ -554,7 +586,7 @@ int igt_main()
>>   	data_t data;
>>   
>>   	igt_fixture() {
>> -		ultra_joiner_supported = false;
>> +		data.ultra_joiner_supported = false;
>>   		data.big_joiner_output_count = 0;
>>   		data.ultra_joiner_output_count = 0;
>>   		data.non_big_joiner_output_count = 0;
>> @@ -574,7 +606,7 @@ int igt_main()
>>   		is_dgfx = is_xe_device(data.drm_fd) ? xe_has_vram(data.drm_fd) : gem_has_lmem(data.drm_fd);
>>   		display_ver = intel_display_ver(intel_get_drm_devid(data.drm_fd));
>>   		if (is_dgfx && display_ver == 14)
>> -			ultra_joiner_supported = true;
>> +			data.ultra_joiner_supported = true;
>>   
>>   		for_each_connected_output(&data.display, output) {
>>   			bool ultrajoiner_found = false, bigjoiner_found = false, force_joiner_supported = false;
>> @@ -630,32 +662,25 @@ int igt_main()
>>   
>>   	igt_describe("Verify the basic modeset on big joiner mode on all pipes");
>>   	igt_subtest_with_dynamic("basic-big-joiner") {
>> -			igt_require_f(data.big_joiner_output_count > 0,
>> -				      "No bigjoiner output found\n");
>> -			igt_require_f(data.n_pipes > 1,
>> -				      "Minimum 2 pipes required\n");
>> -			igt_dynamic_f("single-joiner")
>> -				test_single_joiner(&data, data.big_joiner_output_count, false);
>> -			if (data.big_joiner_output_count > 1)
>> -				igt_dynamic_f("multi-joiner")
>> -					test_multi_joiner(&data, data.big_joiner_output_count, false);
>> +		require_big_joiner(&data, FORCE_DISABLE);
>> +		igt_dynamic_f("single-joiner")
>> +			test_single_joiner(&data, data.big_joiner_output_count, false);
>> +		if (data.big_joiner_output_count > 1)
>> +			igt_dynamic_f("multi-joiner")
>> +				test_multi_joiner(&data, data.big_joiner_output_count, false);
>>   	}
>>   
>>   	igt_describe("Verify the basic modeset on ultra joiner mode on all pipes");
>>   	igt_subtest_with_dynamic("basic-ultra-joiner") {
>> -			igt_require_f(data.ultra_joiner_output_count > 0,
>> -				      "No ultrajoiner output found\n");
>> -			igt_require_f(data.n_pipes > 3,
>> -				      "Minimum 4 pipes required\n");
>> -			igt_dynamic_f("single-joiner")
>> -				test_ultra_joiner(&data, false, false, false);
>> +		require_big_joiner(&data, FORCE_DISABLE);
>> +		igt_dynamic_f("single-joiner")
>> +			test_ultra_joiner(&data, false, false, false);
>>   	}
>>   
>>   	igt_describe("Verify if the modeset on the adjoining pipe is rejected "
>>   		     "when the pipe is active with a big joiner modeset");
>>   	igt_subtest_with_dynamic("invalid-modeset-big-joiner") {
>> -		igt_require_f(data.big_joiner_output_count > 0, "Non big joiner output not found\n");
>> -		igt_require_f(data.n_pipes > 1, "Minimum of 2 pipes are required\n");
>> +		require_big_joiner(&data, FORCE_DISABLE);
>>   		if (data.big_joiner_output_count >= 1)
>>   			igt_dynamic_f("big_joiner_on_last_pipe")
>>   				test_joiner_on_last_pipe(&data, false);
>> @@ -670,9 +695,7 @@ int igt_main()
>>   	igt_describe("Verify if the modeset on the other pipes are rejected "
>>   		     "when the pipe A is active with a ultra joiner modeset");
>>   	igt_subtest_with_dynamic("invalid-modeset-ultra-joiner") {
>> -		igt_require_f(data.ultra_joiner_output_count > 0, "Ultra joiner output not found\n");
>> -		igt_require_f(data.n_pipes > 3, "Minimum of 4 pipes are required\n");
>> -
>> +		require_ultra_joiner(&data, FORCE_DISABLE);
>>   		igt_dynamic_f("ultra_joiner_on_invalid_pipe")
>>   			test_ultra_joiner(&data, true, false, false);
>>   		if (data.non_ultra_joiner_output_count > 0) {
>> @@ -681,12 +704,9 @@ int igt_main()
>>   		}
>>   	}
>>   
>> -	igt_describe("Verify the basic modeset on big joiner mode on all pipes");
>> +	igt_describe("Verify the basic modeset on force big joiner mode on all pipes");
>>   	igt_subtest_with_dynamic("basic-force-big-joiner") {
>> -		igt_require_f(data.non_big_joiner_output_count > 0,
>> -			      "No non big joiner output found\n");
>> -		igt_require_f(data.n_pipes > 1,
>> -			      "Minimum 2 pipes required\n");
>> +		require_big_joiner(&data, FORCE_ENABLE);
>>   		igt_dynamic_f("single") {
>>   			enable_force_joiner_on_all_non_big_joiner_outputs(&data);
>>   			test_single_joiner(&data, data.non_big_joiner_output_count, true);
>> @@ -703,10 +723,7 @@ int igt_main()
>>   	}
>>   
>>   	igt_subtest_with_dynamic("invalid-modeset-force-big-joiner") {
>> -		igt_require_f(data.non_big_joiner_output_count > 0,
>> -			      "Non big joiner output not found\n");
>> -		igt_require_f(data.n_pipes > 1,
>> -			      "Minimum of 2 pipes are required\n");
>> +		require_big_joiner(&data, FORCE_ENABLE);
>>   		if (data.non_big_joiner_output_count >= 1) {
>>   			igt_dynamic_f("big_joiner_on_last_pipe") {
>>   				enable_force_joiner_on_all_non_big_joiner_outputs(&data);
>> @@ -724,14 +741,9 @@ int igt_main()
>>   		}
>>   	}
>>   
>> -	igt_describe("Verify the basic modeset on ultra joiner mode on all pipes");
>> +	igt_describe("Verify the basic modeset on force ultra joiner mode on all pipes");
>>   	igt_subtest_with_dynamic("basic-force-ultra-joiner") {
>> -		igt_require_f(ultra_joiner_supported,
>> -			      "Ultra joiner not supported on this platform\n");
>> -		igt_require_f(data.non_ultra_joiner_output_count > 0,
>> -			      "No non ultra joiner output found\n");
>> -		igt_require_f(data.n_pipes > 3,
>> -			      "Minimum 4 pipes required\n");
>> +		require_ultra_joiner(&data, FORCE_ENABLE);
>>   		igt_dynamic_f("single") {
>>   			enable_force_joiner_on_all_non_ultra_joiner_outputs(&data);
>>   			test_ultra_joiner(&data, false, false, true);
>> @@ -745,7 +757,7 @@ int igt_main()
>>   			      "Ultra joiner not supported on this platform\n");
>>   		igt_require_f(data.ultra_joiner_output_count > 0 ||
>>   			      data.non_ultra_joiner_output_count > 0,
>> -				  "No ultra joiner or force ultra joiner output found\n");
>> +			      "No ultra joiner or force ultra joiner output found\n");
>>   		igt_require_f(data.n_pipes > 3,
>>   			      "Minimum 4 pipes required\n");
>>   
>> @@ -754,13 +766,7 @@ int igt_main()
>>   	}
>>   
>>   	igt_subtest_with_dynamic("invalid-modeset-force-ultra-joiner") {
>> -		igt_require_f(ultra_joiner_supported,
>> -			      "Ultra joiner not supported on this platform\n");
>> -		igt_require_f(data.non_ultra_joiner_output_count > 0,
>> -			      "Non ultra joiner output not found\n");
>> -		igt_require_f(data.n_pipes > 3,
>> -			      "Minimum of 3 pipes are required\n");
>> -
>> +		require_ultra_joiner(&data, FORCE_ENABLE);
>>   		igt_dynamic_f("ultra_joiner_on_invalid_pipe") {
>>   			enable_force_joiner_on_all_non_ultra_joiner_outputs(&data);
>>   			test_ultra_joiner(&data, true, false, true);
>> -- 
>> 2.43.0
>>

  reply	other threads:[~2025-12-15  8:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-12  5:57 [PATCH i-g-t v3 0/2] tests/intel/kms_joiner: Add function for pretest checks Karthik B S
2025-12-12  5:57 ` [PATCH i-g-t v3 1/2] Revert "tests/intel/kms_joiner: Cleanup igt_require checks" Karthik B S
2025-12-12  5:57 ` [PATCH i-g-t v3 2/2] tests/intel/kms_joiner: Add function for pretest checks Karthik B S
2025-12-12  9:16   ` B, Jeevan
2025-12-15  8:52     ` Karthik B S
2025-12-12 12:32   ` Kamil Konieczny
2025-12-15  8:53     ` Karthik B S [this message]
2025-12-12  7:54 ` ✓ i915.CI.BAT: success for tests/intel/kms_joiner: Add function for pretest checks (rev3) Patchwork
2025-12-12 12:19 ` ✗ i915.CI.Full: failure " Patchwork
2025-12-12 20:12 ` ✗ Xe.CI.Full: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b1a54ed1-ff37-4b7b-b11e-b7fb28aa1ece@intel.com \
    --to=karthik.b.s@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jeevan.b@intel.com \
    --cc=kamil.konieczny@linux.intel.com \
    --cc=santhosh.reddy.guddati@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).