Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Sharma, Swati2" <swati2.sharma@intel.com>
To: Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
	igt-dev@lists.freedesktop.org, petri.latvala@intel.com
Subject: Re: [igt-dev] [i-g-t] tests/kms_cursor_crc: Drop max-size test
Date: Thu, 28 Jul 2022 00:12:57 +0530	[thread overview]
Message-ID: <4330ad72-d7b5-80eb-0236-83944fd6f063@intel.com> (raw)
In-Reply-To: <20220726031116.974261-1-bhanuprakash.modem@intel.com>

LGTM
Reviewed-by:  Swati Sharma <swati2.sharma@intel.com>

On 26-Jul-22 8:41 AM, Bhanuprakash Modem wrote:
> As we already covering it by the other tests, there is no point in
> doing the "max-size" test. Hence dropping it.
> 
> This patch will also do some cleanup to avoid skips in igt_dynamic.
> 
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
> ---
>   tests/kms_cursor_crc.c | 47 ++++++++++++++++++++----------------------
>   1 file changed, 22 insertions(+), 25 deletions(-)
> 
> diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
> index f07a045a..14d4c4ca 100644
> --- a/tests/kms_cursor_crc.c
> +++ b/tests/kms_cursor_crc.c
> @@ -576,7 +576,7 @@ static void test_cursor_opaque(data_t *data)
>   	test_cursor_alpha(data);
>   }
>   
> -static void require_cursor_size(data_t *data, int w, int h)
> +static bool require_cursor_size(data_t *data, int w, int h)
>   {
>   	igt_fb_t primary_fb;
>   	drmModeModeInfo *mode;
> @@ -618,14 +618,11 @@ static void require_cursor_size(data_t *data, int w, int h)
>   	igt_remove_fb(data->drm_fd, &primary_fb);
>   	igt_output_set_pipe(output, PIPE_NONE);
>   
> -	igt_skip_on_f(ret, "Cursor size %dx%d not supported by driver\n", w, h);
> +	return !!ret;
>   }
>   
>   static void run_test(data_t *data, void (*testfunc)(data_t *), int cursor_w, int cursor_h)
>   {
> -	if (data->fb.fb_id != 0)
> -		require_cursor_size(data, cursor_w, cursor_h);
> -
>   	prepare_crtc(data, cursor_w, cursor_h);
>   	testfunc(data);
>   	cleanup_crtc(data);
> @@ -696,24 +693,15 @@ static void run_size_tests(data_t *data, void (*testfunc)(data_t *),
>   	char name[32];
>   	enum pipe pipe;
>   
> -	if (w == 0 && h == 0)
> -		strcpy(name, "max-size");
> -	else
> -		snprintf(name, sizeof(name), "%dx%d", w, h);
> -
> -	if (w == 0 && h == 0) {
> -		w = data->cursor_max_w;
> -		h = data->cursor_max_h;
> -		/*
> -		 * No point in doing the "max-size" test if
> -		 * it was already covered by the other tests.
> -		 */
> -		igt_require_f(w != h || w > 512 || h > 512 ||
> -			      !is_power_of_two(w) || !is_power_of_two(h),
> -			      "Cursor max size %dx%d already covered by other tests\n",
> -			      w, h);
> -	}
> +	snprintf(name, sizeof(name), "%dx%d", w, h);
> +
>   	create_cursor_fb(data, w, h);
> +	if (require_cursor_size(data, w, h)) {
> +		igt_debug("Cursor size %dx%d not supported by driver\n", w, h);
> +
> +		igt_remove_fb(data->drm_fd, &data->fb);
> +		return;
> +	}
>   
>   	for_each_pipe(&data->display, pipe) {
>   		data->pipe = pipe;
> @@ -807,6 +795,12 @@ static void run_tests_on_pipe(data_t *data)
>   			data->pipe = pipe;
>   			data->flags = TEST_DPMS;
>   
> +			if (require_cursor_size(data, data->cursor_max_w, data->cursor_max_h)) {
> +				igt_debug("Cursor size %dx%d not supported by driver\n",
> +					  data->cursor_max_w, data->cursor_max_h);
> +				continue;
> +			}
> +
>   			igt_dynamic_f("pipe-%s-%s",
>   				      kmstest_pipe_name(pipe),
>   				      data->output->name)
> @@ -822,6 +816,12 @@ static void run_tests_on_pipe(data_t *data)
>   			data->pipe = pipe;
>   			data->flags = TEST_SUSPEND;
>   
> +			if (require_cursor_size(data, data->cursor_max_w, data->cursor_max_h)) {
> +				igt_debug("Cursor size %dx%d not supported by driver\n",
> +					  data->cursor_max_w, data->cursor_max_h);
> +				continue;
> +			}
> +
>   			igt_dynamic_f("pipe-%s-%s",
>   				      kmstest_pipe_name(pipe),
>   				      data->output->name)
> @@ -855,9 +855,6 @@ static void run_tests_on_pipe(data_t *data)
>   					igt_subtest_group
>   						run_size_tests(data, size_tests[i].testfunc, w, h);
>   				}
> -
> -				igt_subtest_group
> -					run_size_tests(data, size_tests[i].testfunc, 0, 0);
>   			}
>   		}
>   	}

-- 
~Swati Sharma

  parent reply	other threads:[~2022-07-27 18:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26  3:11 [igt-dev] [i-g-t] tests/kms_cursor_crc: Drop max-size test Bhanuprakash Modem
2022-07-26  3:50 ` [igt-dev] ✗ Fi.CI.BAT: failure for " Patchwork
2022-07-26  4:41 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_cursor_crc: Drop max-size test (rev2) Patchwork
2022-07-26  6:42 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_cursor_crc: Drop max-size test (rev3) Patchwork
2022-07-26  6:54   ` Modem, Bhanuprakash
2022-07-26 18:52     ` Vudum, Lakshminarayana
2022-07-26 17:38 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2022-07-27  0:10 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-07-27  2:47 ` [igt-dev] ✗ Fi.CI.BAT: failure for tests/kms_cursor_crc: Drop max-size test (rev4) Patchwork
2022-07-27  2:51   ` Modem, Bhanuprakash
2022-07-27  4:58 ` [igt-dev] ✓ Fi.CI.BAT: success " Patchwork
2022-07-27  6:20 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2022-07-27 18:42 ` Sharma, Swati2 [this message]
2022-08-09 14:36   ` [igt-dev] [i-g-t] tests/kms_cursor_crc: Drop max-size test Juha-Pekka Heikkila
2022-08-09 15:08     ` Modem, Bhanuprakash
2022-08-09 15:31       ` Juha-Pekka Heikkila
2022-08-09 16:45         ` Modem, Bhanuprakash

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=4330ad72-d7b5-80eb-0236-83944fd6f063@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=bhanuprakash.modem@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=petri.latvala@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