diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2024-03-22 22:20:19 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2024-05-03 13:19:02 +0300 |
commit | e1d202abb373e78b80e92814924316ee6b52b569 (patch) | |
tree | 4e591557cb7773d9b90c8961d64a894e2ad6d888 | |
parent | fc22d11bc27a56a4bced7c41e6c2170f54887e43 (diff) |
tests/kms_async_flips: Allow the first async flip to change modifier
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.
Reviewed-by: Vandita Kulkarni <vandita.kulkarni@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-rw-r--r-- | tests/kms_async_flips.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/tests/kms_async_flips.c b/tests/kms_async_flips.c index efbc8778d..1c80e9514 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) @@ -726,6 +735,8 @@ igt_main /* 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)); run_test(&data, test_invalid); |