[PATCH i-g-t v6 1/1] tests/kms_async_flips: Async flips suspend resume test
Karthik B S
karthik.b.s at intel.com
Thu Oct 3 04:39:22 UTC 2024
Hi Santhosh,
On 9/30/2024 5:34 PM, Santhosh Reddy Guddati wrote:
> Test functionality of async flips with suspend and resume
>
> v2: Re-use existing function and use s/r API (Swathi)
> v6: Remove HAX patch
Please remove this v6 comment as it is from a separate patch.
>
> Signed-off-by: Santhosh Reddy Guddati <santhosh.reddy.guddati at intel.com>
> ---
> tests/kms_async_flips.c | 15 +++++++++++++++
> 1 file changed, 15 insertions(+)
>
> diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
> index 5b70c4033..08510e70d 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
> @@ -99,6 +102,7 @@ typedef struct {
> bool flip_pending;
> enum pipe pipe;
> bool alternate_sync_async;
> + bool suspend_resume;
> bool allow_fail;
> struct buf_ops *bops;
> } data_t;
> @@ -260,6 +264,7 @@ static void test_async_flip(data_t *data)
> int ret, frame;
> long long int fps;
> struct timeval start, end, diff;
> + int suspend_time = 1;
>
> igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
>
> @@ -312,6 +317,10 @@ static void test_async_flip(data_t *data)
> data->flip_interval, data->refresh_rate, MIN_FLIPS_PER_FRAME);
> }
>
> + if (data->suspend_resume && diff.tv_sec == suspend_time) {
> + igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
> + suspend_time = 0;
> + }
> frame++;
> } while (diff.tv_sec < RUN_TIME);
>
> @@ -750,6 +759,12 @@ 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") {
> + data.suspend_resume = true;
The suspend_resume variable needs to be reset somewhere. May be we would
do it once inside the 'if (suspend_resume)' itself.
With this fixed, Reviewed-by: Karthik B S <karthik.b.s at intel.com>
Thanks,
Karthik.B.S
> + run_test(&data, test_async_flip);
> + }
> +
> igt_fixture {
> for (i = 0; i < NUM_FBS; i++)
> igt_remove_fb(data.drm_fd, &data.bufs[i]);
More information about the igt-dev
mailing list