[PATCH i-g-t v3 5/5] tests/kms_async_flips: Add DPMS subtest
Reddy Guddati, Santhosh
santhosh.reddy.guddati at intel.com
Fri Jul 25 09:56:12 UTC 2025
Hi Karthik,
On 23-07-2025 11:23, Karthik B S wrote:
> Test functionality of async flips with DPMS.
>
> v2: Update runtime to accomodate for first flip after DPMS (Arun)
>
> v3: Rebase.
>
> Signed-off-by: Karthik B S <karthik.b.s at intel.com>
LGTM,
Reviewed-by: Santhosh Reddy Guddati <santhosh.reddy.guddati at intel.com>> ---
> tests/kms_async_flips.c | 36 ++++++++++++++++++++++++++++++++++--
> 1 file changed, 34 insertions(+), 2 deletions(-)
>
> diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
> index 1d8ee10a9..8a943fe01 100644
> --- a/tests/kms_async_flips.c
> +++ b/tests/kms_async_flips.c
> @@ -90,6 +90,9 @@
> * SUBTEST: async-flip-hang
> * Description: Verify the async flip functionality with hang cycle
> *
> + * SUBTEST: async-flip-dpms
> + * Description: Verify the async flip functionality with dpms cycle
> + *
> * SUBTEST: overlay-atomic
> * Description: Verify overlay planes with async flips in atomic API
> *
> @@ -141,6 +144,7 @@ typedef struct {
> bool alternate_sync_async;
> bool suspend_resume;
> bool hang;
> + bool dpms;
> struct buf_ops *bops;
> bool atomic_path;
> bool overlay_path;
> @@ -386,6 +390,21 @@ static int perform_flip(data_t *data, int frame, int flags)
> return ret;
> }
>
> +static void check_dpms(igt_output_t *output)
> +{
> + igt_require(igt_setup_runtime_pm(output->display->drm_fd));
> +
> + kmstest_set_connector_dpms(output->display->drm_fd,
> + output->config.connector,
> + DRM_MODE_DPMS_OFF);
> + igt_require(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED));
> +
> + kmstest_set_connector_dpms(output->display->drm_fd,
> + output->config.connector,
> + DRM_MODE_DPMS_ON);
> + igt_assert(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_ACTIVE));
> +}
> +
> static void test_async_flip(data_t *data)
> {
> int ret, frame;
> @@ -395,7 +414,7 @@ static void test_async_flip(data_t *data)
> uint64_t ahnd = 0;
> int mid_time = RUN_TIME / 2;
> float run_time;
> - bool temp = data->suspend_resume || data->hang;
> + bool temp = data->suspend_resume || data->hang || data->dpms;
>
> igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
>
> @@ -488,10 +507,15 @@ static void test_async_flip(data_t *data)
> break;
> }
>
> + if (data->dpms && diff.tv_sec == mid_time && temp) {
> + temp = false;
> + check_dpms(data->output);
> + }
> +
> frame++;
> } while (diff.tv_sec < RUN_TIME);
>
> - if (data->suspend_resume)
> + if (data->suspend_resume || data->dpms)
> run_time = RUN_TIME - (1.0 / data->refresh_rate);
> else
> run_time = RUN_TIME;
> @@ -1206,6 +1230,14 @@ igt_main
> data.hang = false;
> }
>
> + igt_describe("Verify the async flip functionality after dpms cycle");
> + igt_subtest_with_dynamic("async-flip-dpms") {
> + test_init_ops(&data);
> + data.dpms = true;
> + run_test(&data, test_async_flip);
> + data.dpms = false;
> + }
> +
> 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