Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Ser <contact@emersion.fr>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH] tests/kms_vblank: add PAGE_FLIP_EVENT property test
Date: Sat, 30 May 2026 18:35:30 +0000	[thread overview]
Message-ID: <20260530183521.5562-1-contact@emersion.fr> (raw)

This patch introduces a test for the new PAGE_FLIP_EVENT CRTC
property:
https://lore.kernel.org/dri-devel/20260530171422.4615-1-contact@emersion.fr/T/#u

Signed-off-by: Simon Ser <contact@emersion.fr>
---
 lib/igt_kms.c      |  1 +
 lib/igt_kms.h      |  1 +
 tests/kms_vblank.c | 45 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 47 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 0f1ce03a943b..b9f780445448 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -739,6 +739,7 @@ const char * const igt_crtc_prop_names[IGT_NUM_CRTC_PROPS] = {
 	[IGT_CRTC_VRR_ENABLED] = "VRR_ENABLED",
 	[IGT_CRTC_SCALING_FILTER] = "SCALING_FILTER",
 	[IGT_CRTC_SHARPNESS_STRENGTH] = "SHARPNESS_STRENGTH",
+	[IGT_CRTC_PAGE_FLIP_EVENT] = "PAGE_FLIP_EVENT",
 };
 
 const char * const igt_connector_prop_names[IGT_NUM_CONNECTOR_PROPS] = {
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index c2a3099de40f..80f6508f3073 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -166,6 +166,7 @@ enum igt_atomic_crtc_properties {
        IGT_CRTC_VRR_ENABLED,
        IGT_CRTC_SCALING_FILTER,
        IGT_CRTC_SHARPNESS_STRENGTH,
+       IGT_CRTC_PAGE_FLIP_EVENT,
        IGT_NUM_CRTC_PROPS
 };
 
diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index 7fb7de0a70c1..a54db8a54d90 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -288,6 +288,30 @@ static void crtc_id_subtest(data_t *data, int fd)
 	return;
 }
 
+static void page_flip_event_prop_subtest(data_t *data, int fd) {
+	igt_display_t *display = &data->display;
+	igt_output_t *output = data->output;
+	igt_crtc_t *crtc = data->crtc;
+	struct drm_event_vblank buf;
+	igt_plane_t *primary;
+
+	igt_require(display->is_atomic);
+	igt_require(igt_crtc_has_prop(crtc, IGT_CRTC_PAGE_FLIP_EVENT));
+
+	prepare_crtc(data, fd, output);
+
+	primary = igt_output_get_plane(output, 0);
+
+	igt_plane_set_fb(primary, &data->primary_fb);
+	igt_crtc_set_prop_value(crtc, IGT_CRTC_PAGE_FLIP_EVENT, 1);
+	igt_display_commit_atomic(display, 0, NULL);
+
+	igt_assert_eq(read(fd, &buf, sizeof(buf)), sizeof(buf));
+	igt_assert_eq(buf.crtc_id, crtc->crtc_id);
+
+	cleanup_crtc(data, fd, output);
+}
+
 static void accuracy(data_t *data, int fd, int nchildren)
 {
 	const uint32_t pipe_id_flag = igt_crtc_get_vbl_flag(data->crtc);
@@ -692,6 +716,27 @@ int igt_main_args("e", NULL, help_str, opt_handler, NULL)
 		}
 	}
 
+	igt_describe("Check flip events works with the PAGE_FLIP_EVENT atomic property.");
+	igt_subtest_with_dynamic("page-flip-event-prop") {
+		for_each_crtc_with_valid_output(&data.display, crtc,
+						data.output) {
+			if (!crtc_output_combo_valid(&data.display, crtc, data.output))
+				continue;
+
+			if (!all_pipes && crtc->crtc_index != active_crtcs[0] &&
+					  crtc->crtc_index != active_crtcs[last_crtc_index]) {
+				igt_info("Skipping pipe %s\n",
+					 igt_crtc_name(crtc));
+				continue;
+			}
+
+			data.crtc = crtc;
+			igt_dynamic_f("pipe-%s-%s", igt_crtc_name(crtc),
+				      data.output->name)
+				      page_flip_event_prop_subtest(&data, fd);
+		}
+	}
+
 	run_subtests(&data);
 
 	igt_fixture() {
-- 
2.54.0



                 reply	other threads:[~2026-05-30 18:36 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20260530183521.5562-1-contact@emersion.fr \
    --to=contact@emersion.fr \
    --cc=igt-dev@lists.freedesktop.org \
    /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