Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Modem, Bhanuprakash" <bhanuprakash.modem@intel.com>
To: "B, Jeevan" <jeevan.b@intel.com>,
	Kamil Konieczny <kamil.konieczny@linux.intel.com>,
	"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_setmode: Fix dynamic subtests
Date: Fri, 23 Jun 2023 09:22:53 +0530	[thread overview]
Message-ID: <fb4bf754-3a4e-7857-b341-8df458ee21bc@intel.com> (raw)
In-Reply-To: <DM4PR11MB6312D2BF62243D9C688C0FD29022A@DM4PR11MB6312.namprd11.prod.outlook.com>

Hi Jeevan,

On Thu-22-06-2023 06:32 pm, B, Jeevan wrote:
> Hi Kamil,
> 
>> -----Original Message-----
>> From: Kamil Konieczny <kamil.konieczny@linux.intel.com>
>> Sent: Thursday, June 22, 2023 6:26 PM
>> To: igt-dev@lists.freedesktop.org
>> Cc: B, Jeevan <jeevan.b@intel.com>; Modem, Bhanuprakash
>> <bhanuprakash.modem@intel.com>
>> Subject: Re: [PATCH i-g-t] tests/kms_setmode: Fix dynamic subtests
>>
>> Hi Jeevan,
>>
>> On 2023-06-22 at 16:46:51 +0530, Jeevan B wrote:
>>> basic-clone-single-crtc and invalid-clone-exclusive-crtc were not part
>>> of dynamic subtest so tests were getting skipped. fixed the test to
>>> execute skipping tests as expected.
>>>
>>> v2: add missing call.
>>>
>>> Signed-off-by: Jeevan B <jeevan.b@intel.com>
>>> ---
>>>   tests/kms_setmode.c | 26 +++++++++++++-------------
>>>   1 file changed, 13 insertions(+), 13 deletions(-)
>>>
>>> diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c index
>>> a611d938..96fb0b4b 100644
>>> --- a/tests/kms_setmode.c
>>> +++ b/tests/kms_setmode.c
>>> @@ -647,20 +647,19 @@ static void test_one_combination(const struct
>> test_config *tconf,
>>>   	struct crtc_config crtcs[MAX_CRTCS];
>>>   	int crtc_count;
>>>   	bool config_valid;
>>> +	int i, pos = 0;
>>> +	char test_name[256];
>>>
>>>   	setup_crtcs(tconf, cconfs, connector_count, crtcs,
>>>   		    &crtc_count, &config_valid);
>>>
>>> -	if (config_valid == !(tconf->flags & TEST_INVALID)) {
>>> -		int i, pos = 0;
>>> -		char test_name[256];
>>> -
>>> -		for (i = 0; i < crtc_count; i++) {
>>> -			if (i > 0)
>>> -				pos += snprintf(&test_name[pos],
>> ARRAY_SIZE(test_name) - pos, "-");
>>> -			pos += get_test_name_str(&crtcs[i],
>> &test_name[pos], ARRAY_SIZE(test_name) - pos);
>>> -		}
>>> +	for (i = 0; i < crtc_count; i++) {
>>> +		if (i > 0)
>>> +			pos += snprintf(&test_name[pos],
>> ARRAY_SIZE(test_name) - pos, "-");
>>> +		pos += get_test_name_str(&crtcs[i], &test_name[pos],
>> ARRAY_SIZE(test_name) - pos);
>>> +	}
>>>
>>> +	if (config_valid == !(tconf->flags & TEST_INVALID)) {
>>>   		for (i = 0; i < crtc_count; i++) {
>>>   			struct crtc_config *crtc = &crtcs[i];
>>>
>>> @@ -679,16 +678,17 @@ static void test_one_combination(const struct
>> test_config *tconf,
>>>   			    ((i > 0) && (crtc[i - 1].mode.hdisplay >
>> MAX_HDISPLAY_PER_CRTC) &&
>>>   			     (abs(crtc->crtc_idx - crtcs[i - 1].crtc_idx) <= 1))) {
>>>   				igt_info("Combo: %s is not possible with
>> selected mode(s).\n", test_name);
>>> -				goto out;
>>> +				cleanup_crtcs(crtcs, crtc_count);
>>> +				return;
>>>   			}
>>>   		}
>>>
>>>   		igt_dynamic_f("%s", test_name)
>>>   			test_crtc_config(tconf, crtcs, crtc_count);
>>> +	} else {
>>> +		igt_dynamic_f("%s", test_name)
>>> +			cleanup_crtcs(crtcs, crtc_count);
>> ----------------------- ^
>> The name of function and its placement just before function end suggest it is
>> a cleanup, not a test.
>>
>> I would advise going with git log and finding when these two tests where
>> executed with "normal", non-dynamic way and then adjusting this function,
>> or adding them as separate subtests with proper configuration.
>>
> This was before tests were converted to dynamic. (9f32d552afd7e7bb34b4cc3542e184b3be1a1dc8)
> @@ -664,8 +684,19 @@ static void test_one_combination(const struct test_config *tconf,
>          setup_crtcs(tconf, cconfs, connector_count, crtcs,
>                      &crtc_count, &config_valid);
> 
> -       if (config_valid == !(tconf->flags & TEST_INVALID))
> -               test_crtc_config(tconf, crtcs, crtc_count);
> +       if (config_valid == !(tconf->flags & TEST_INVALID)) {
> +               int i, pos = 0;
> +               char test_name[256];
> +
> +               for (i = 0; i < crtc_count; i++) {
> +                       if (i > 0)
> +                               pos += snprintf(&test_name[pos], ARRAY_SIZE(test_name) - pos, "-");
> +                       pos += get_test_name_str(&crtcs[i], &test_name[pos], ARRAY_SIZE(test_name) - pos);
> +               }
> +
> +               igt_dynamic_f("%s", test_name)
> +                       test_crtc_config(tconf, crtcs, crtc_count);
> +       }

What is wrong in this logic & how your patch fixes that?

- Bhanu

> 
>          cleanup_crtcs(crtcs, crtc_count);
>   }
> 
>>>   	}
>>> -
>>> -out:
>>> -	cleanup_crtcs(crtcs, crtc_count);
>>
>> Drop this change, looks dangereous.
>>
>> Regards,
>> Kamil
> 
>>
>>>   }
>>>
>>>   static int assign_crtc_to_connectors(const struct test_config *tconf,
>>> --
>>> 2.41.0
>>>

  reply	other threads:[~2023-06-23  3:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-22 11:16 [igt-dev] [PATCH i-g-t] tests/kms_setmode: Fix dynamic subtests Jeevan B
2023-06-22 12:18 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_setmode: Fix dynamic subtests (rev2) Patchwork
2023-06-22 12:55 ` [igt-dev] [PATCH i-g-t] tests/kms_setmode: Fix dynamic subtests Kamil Konieczny
2023-06-22 13:02   ` B, Jeevan
2023-06-23  3:52     ` Modem, Bhanuprakash [this message]
2023-06-23  3:49 ` Modem, Bhanuprakash
2023-06-23  4:20   ` B, Jeevan
2023-06-23  4:49   ` B, Jeevan
  -- strict thread matches above, loose matches on Subject: below --
2023-06-20 18:25 Jeevan B
2023-06-21 16:43 ` Kamil Konieczny

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=fb4bf754-3a4e-7857-b341-8df458ee21bc@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jeevan.b@intel.com \
    --cc=kamil.konieczny@linux.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