Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Sharma, Swati2" <swati2.sharma@intel.com>
To: Santhosh Reddy Guddati <santhosh.reddy.guddati@intel.com>,
	igt-dev@lists.freedesktop.org
Cc: karthik.b.s@intel.com
Subject: Re: [PATCH i-g-t 1/1] tests/kms_async_flips: add async flips suspend resume tests
Date: Mon, 9 Sep 2024 23:30:45 +0530	[thread overview]
Message-ID: <6d912f26-b9a9-49d0-9ec2-19cf03812765@intel.com> (raw)
In-Reply-To: <20240906072824.509607-2-santhosh.reddy.guddati@intel.com>

Hi Santosh,

Please find my review comments below:

Fix subject,
s/tests/test

Also, cover-letter can be avoided for single patch.

On 06-Sep-24 12:58 PM, Santhosh Reddy Guddati wrote:
> ---

Commit message missing. Please add.

>   tests/kms_async_flips.c | 53 +++++++++++++++++++++++++++++++++++++++++
>   1 file changed, 53 insertions(+)
> 
> diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
> index 5b70c4033..fd851397e 100644
> --- a/tests/kms_async_flips.c
> +++ b/tests/kms_async_flips.c
> @@ -66,6 +66,9 @@
>    *
>    * SUBTEST: invalid-async-flip
>    * Description: Negative case to verify if changes in fb are rejected from kernel as expected
> + *
> + * SUBTEST: async-flip-suspend-resume
> + * Description: Verify the async flip functionality with suspend and resume cycle
>    */
>   
>   #define CURSOR_POS 128
> @@ -672,6 +675,51 @@ static void run_test_with_modifiers(data_t *data, void (*test)(data_t *))
>   	}
>   }
>   
> +static void test_async_flip_suspend_resume(data_t *data)

Instead of adding new func(), is it possible to modify test_async_flip() 
to accommodate suspend resume api calls ?

> +{
> +	int ret, frame;
> +	long long int fps;
> +	struct timeval start, end, diff;
> +	int suspend_time = 1;
> +	int resume_time = 1;
> +
> +	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
> +
> +	gettimeofday(&start, NULL);
> +	frame = 1;
> +	do {
> +		int flags = DRM_MODE_PAGE_FLIP_ASYNC | DRM_MODE_PAGE_FLIP_EVENT;
> +
> +		ret = drmModePageFlip(data->drm_fd, data->crtc_id,
> +				      data->bufs[frame % NUM_FBS].fb_id,
> +				      flags, data);
> +		igt_assert_eq(ret, 0);
> +
> +		wait_flip_event(data);
> +
> +		gettimeofday(&end, NULL);
> +		timersub(&end, &start, &diff);
> +
> +		if (diff.tv_sec == suspend_time) {
> +			igt_info("system suspending\n");
> +			igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
> +			suspend_time = 0;
> +		}
> +
> +		if (diff.tv_sec == resume_time) {
> +			igt_info("system resuming\n");
> +			igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
> +			resume_time = 0;
> +		}
> +
> +		frame++;
> +	} while (diff.tv_sec < RUN_TIME);
> +
> +	fps = frame * 1000 / RUN_TIME;
> +	igt_assert_f((fps / 1000) > (data->refresh_rate * MIN_FLIPS_PER_FRAME),
> +		     "FPS should be significantly higher than the refresh rate\n");
> +}
> +
>   static data_t data;
>   
>   igt_main
> @@ -750,6 +798,11 @@ igt_main
>   		run_test(&data, test_crc);
>   	}
>   
> +	igt_describe("Verify the async flip functionality after suspend and resume cycle");
> +	igt_subtest_with_dynamic("async-flip-suspend-resume") {
> +		run_test(&data, test_async_flip_suspend_resume);
> +	}
> +
>   	igt_fixture {
>   		for (i = 0; i < NUM_FBS; i++)
>   			igt_remove_fb(data.drm_fd, &data.bufs[i]);

  reply	other threads:[~2024-09-09 18:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06  7:28 [PATCH i-g-t 0/1] validate async flips during suspend resume Santhosh Reddy Guddati
2024-09-06  7:28 ` [PATCH i-g-t 1/1] tests/kms_async_flips: add async flips suspend resume tests Santhosh Reddy Guddati
2024-09-09 18:00   ` Sharma, Swati2 [this message]
2024-09-11  6:53   ` [PATCH i-g-t v2] tests/kms_async_flips: Async flips suspend resume test Santhosh Reddy Guddati
2024-09-06 13:17 ` ✓ Fi.CI.BAT: success for validate async flips during suspend resume Patchwork
2024-09-06 13:23 ` ✓ CI.xeBAT: " Patchwork
2024-09-09  9:00 ` ✗ CI.xeFULL: failure " Patchwork
2024-09-10  9:16 ` ✗ Fi.CI.IGT: " Patchwork
2024-09-10 18:06 ` [PATCH i-g-t] tests/kms_async_flips: Async flips suspend resume test Santhosh Reddy Guddati
2024-09-12  4:17 ` ✗ Fi.CI.BAT: failure for tests/kms_async_flips: Async flips suspend resume test (rev2) Patchwork
2024-09-12  4:30 ` ✗ CI.xeBAT: " Patchwork
2024-09-12  9:28 ` ✗ CI.xeFULL: " 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=6d912f26-b9a9-49d0-9ec2-19cf03812765@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=karthik.b.s@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