Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [PATCH i-g-t 2/2] tests/kms_async_flips: Allow the first async flip to change modifier
Date: Fri, 22 Mar 2024 22:37:26 +0200	[thread overview]
Message-ID: <20240322203726.16637-2-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20240322203726.16637-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The kernel will now allow the first async flip to change the modifier.
Test that it works as indended: first async flip the attempts to
change the modifier will succeed, and subsequent async flips that
attempt the same will fail.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 tests/kms_async_flips.c | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c
index efbc8778d7e1..1c80e95149eb 100644
--- a/tests/kms_async_flips.c
+++ b/tests/kms_async_flips.c
@@ -438,10 +438,8 @@ static void test_cursor(data_t *data)
 
 static void test_invalid(data_t *data)
 {
-	int flags = DRM_MODE_PAGE_FLIP_ASYNC | DRM_MODE_PAGE_FLIP_EVENT;
-	int ret;
-	uint32_t width, height;
-	struct igt_fb fb;
+	int ret, width, height;
+	struct igt_fb fb[2];
 	drmModeModeInfo *mode;
 
 	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
@@ -451,17 +449,28 @@ static void test_invalid(data_t *data)
 	height = mode->vdisplay;
 
 	igt_create_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
-		      I915_FORMAT_MOD_Y_TILED, &fb);
+		      I915_FORMAT_MOD_X_TILED, &fb[0]);
+	igt_create_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
+		      I915_FORMAT_MOD_Y_TILED, &fb[1]);
 
-	/* Flip with a different fb modifier which is expected to be rejected */
-	ret = drmModePageFlip(data->drm_fd, data->crtc_id,
-			      fb.fb_id, flags, data);
+	igt_plane_set_fb(data->plane, &fb[0]);
+	igt_display_commit2(&data->display, data->display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
 
+	/* first async flip is expected to allow modifier changes */
+	ret = drmModePageFlip(data->drm_fd, data->crtc_id, fb[1].fb_id,
+			      DRM_MODE_PAGE_FLIP_ASYNC | DRM_MODE_PAGE_FLIP_EVENT, data);
+	igt_assert(ret == 0);
+	wait_flip_event(data);
+
+	/* subsequent async flips should reject modifier changes */
+	ret = drmModePageFlip(data->drm_fd, data->crtc_id, fb[0].fb_id,
+			      DRM_MODE_PAGE_FLIP_ASYNC | DRM_MODE_PAGE_FLIP_EVENT, data);
 	igt_assert(ret == -EINVAL);
 
 	/* TODO: Add verification for changes in stride, pixel format */
 
-	igt_remove_fb(data->drm_fd, &fb);
+	igt_remove_fb(data->drm_fd, &fb[1]);
+	igt_remove_fb(data->drm_fd, &fb[0]);
 }
 
 static void queue_vblank(data_t *data)
@@ -725,6 +734,8 @@ igt_main
 	igt_subtest_with_dynamic("invalid-async-flip") {
 		/* TODO: support more vendors */
 		igt_require(is_intel_device(data.drm_fd));
+		igt_require(igt_display_has_format_mod(&data.display, DRM_FORMAT_XRGB8888,
+						       I915_FORMAT_MOD_X_TILED));
 		igt_require(igt_display_has_format_mod(&data.display, DRM_FORMAT_XRGB8888,
 						       I915_FORMAT_MOD_Y_TILED));
 
-- 
2.43.2


  reply	other threads:[~2024-03-22 20:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22 20:37 [PATCH i-g-t 1/2] tests/kms_async_flips: Extend the "async flip needs an extra frame" logic Ville Syrjala
2024-03-22 20:37 ` Ville Syrjala [this message]
2024-04-11 10:15   ` [PATCH i-g-t 2/2] tests/kms_async_flips: Allow the first async flip to change modifier Kulkarni, Vandita
2024-03-22 23:03 ` ✓ CI.xeBAT: success for series starting with [i-g-t,1/2] tests/kms_async_flips: Extend the "async flip needs an extra frame" logic Patchwork
2024-03-22 23:17 ` ✓ Fi.CI.BAT: " Patchwork
2024-03-23 22:37 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-04-11 10:15 ` [PATCH i-g-t 1/2] " Kulkarni, Vandita
2024-04-26 16:44 ` ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tests/kms_async_flips: Extend the "async flip needs an extra frame" logic (rev2) Patchwork
2024-04-26 17:25 ` ✓ CI.xeBAT: " Patchwork
2024-04-26 21:14 ` ✓ Fi.CI.IGT: " Patchwork
2024-04-26 22:03 ` ✗ CI.xeFULL: failure " 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=20240322203726.16637-2-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --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