diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2017-06-28 09:27:54 +0200 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2017-06-28 12:09:09 +0200 |
commit | 9cb998fcaacb25d0d5cca377c498d4063f707501 (patch) | |
tree | 928c8f53a8100b77799f03e43c13767898b2f34b /tests/kms_atomic.c | |
parent | 7d714b2e7221c44ffb2c538173fc249bfa7a3ac7 (diff) |
tests/kms_atomic: Add test for new DRM_MODE_PAGE_FLIP_EVENT behavior.
DRM_MODE_PAGE_FLIP_EVENT is now rejected if no CRTC is affected by the
changes. Make sure the TEST_ONLY test keeps working, and test with
DRM_MODE_PAGE_FLIP_EVENT.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/kms_atomic.c')
-rw-r--r-- | tests/kms_atomic.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/tests/kms_atomic.c b/tests/kms_atomic.c index 6375fede..d77a526f 100644 --- a/tests/kms_atomic.c +++ b/tests/kms_atomic.c @@ -203,7 +203,7 @@ static uint32_t blob_duplicate(int fd, uint32_t id_orig) drmModeAtomicSetCursor(req, 0); \ crtc_populate_req(crtc, req); \ plane_populate_req(plane, req); \ - do_atomic_commit_err((crtc)->state->desc->fd, req, 0, e); \ + do_atomic_commit_err((crtc)->state->desc->fd, req, flags, e); \ crtc_check_current_state(crtc_old, plane_old, relax); \ plane_check_current_state(plane_old, relax); \ } @@ -1205,6 +1205,15 @@ static void crtc_invalid_params(struct kms_atomic_crtc_state *crtc_old, crtc_commit_atomic(&crtc, plane, req, ATOMIC_RELAX_NONE, DRM_MODE_ATOMIC_TEST_ONLY); + /* + * TEST_ONLY cannot be combined with DRM_MODE_PAGE_FLIP_EVENT, + * but DRM_MODE_PAGE_FLIP_EVENT will always generate EINVAL + * without valid crtc, so test it here. + */ + crtc_commit_atomic_err(&crtc, plane, crtc_old, plane, req, + DRM_MODE_ATOMIC_TEST_ONLY | DRM_MODE_PAGE_FLIP_EVENT, + ATOMIC_RELAX_NONE, EINVAL); + /* Create a blob which is the wrong size to be a valid mode. */ do_or_die(drmModeCreatePropertyBlob(crtc.state->desc->fd, crtc.mode.data, @@ -1356,12 +1365,12 @@ static void atomic_invalid_params(struct kms_atomic_crtc_state *crtc, /* Valid pointers, but still should copy nothing. */ do_ioctl(desc->fd, DRM_IOCTL_MODE_ATOMIC, &ioc); - /* Nonsense flags. */ - ioc.flags = 0xdeadbeef; + /* Valid noop, but with event set should fail. */ + ioc.flags = DRM_MODE_PAGE_FLIP_EVENT; do_ioctl_err(desc->fd, DRM_IOCTL_MODE_ATOMIC, &ioc, EINVAL); - /* Specifically forbidden combination. */ - ioc.flags = DRM_MODE_ATOMIC_TEST_ONLY | DRM_MODE_PAGE_FLIP_EVENT; + /* Nonsense flags. */ + ioc.flags = 0xdeadbeef; do_ioctl_err(desc->fd, DRM_IOCTL_MODE_ATOMIC, &ioc, EINVAL); ioc.flags = 0; |