diff options
author | Dave Airlie <airlied@redhat.com> | 2017-10-10 07:42:57 +0100 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-10-10 07:42:57 +0100 |
commit | 14300a7377a0a8ce19300b7e7486d17a028d8c41 (patch) | |
tree | 8d308216f1916854c86e264203e21d52ef34a8a4 | |
parent | f9bd26ce4559d95746c79cb3b64350e050343d37 (diff) |
kms_sequence: add local defs, drop the FIRST_PIXEL_OUT
-rw-r--r-- | tests/kms_sequence.c | 50 |
1 files changed, 39 insertions, 11 deletions
diff --git a/tests/kms_sequence.c b/tests/kms_sequence.c index 3b8ac39d..783dda25 100644 --- a/tests/kms_sequence.c +++ b/tests/kms_sequence.c @@ -58,6 +58,34 @@ typedef struct { #define FORKED 4 } data_t; +struct local_drm_crtc_get_sequence { + __u32 crtc_id; + __u32 active; + __u64 sequence; + __u64 sequence_ns; +}; + +struct local_drm_crtc_queue_sequence { + __u32 crtc_id; + __u32 flags; + __u64 sequence; + __u64 user_data; +}; + +#define LOCAL_DRM_IOCTL_CRTC_GET_SEQUENCE DRM_IOWR(0x3b, struct local_drm_crtc_get_sequence) +#define LOCAL_DRM_IOCTL_CRTC_QUEUE_SEQUENCE DRM_IOWR(0x3c, struct local_drm_crtc_queue_sequence) + +#define LOCAL_DRM_CRTC_SEQUENCE_RELATIVE 0x00000001 /* sequence is relative to current */ +#define LOCAL_DRM_CRTC_SEQUENCE_NEXT_ON_MISS 0x00000002 /* Use next sequence if we've missed */ + +struct local_drm_event_crtc_sequence { + struct drm_event base; + __u64 user_data; + __s64 time_ns; + __u64 sequence; +}; + + static double elapsed(const struct timespec *start, const struct timespec *end, int loop) @@ -106,23 +134,23 @@ static void cleanup_crtc(data_t *data, int fd, igt_output_t *output) igt_display_commit(display); } -static int crtc_get_sequence(int fd, struct drm_crtc_get_sequence *cgs) +static int crtc_get_sequence(int fd, struct local_drm_crtc_get_sequence *cgs) { int err; err = 0; - if (igt_ioctl(fd, DRM_IOCTL_CRTC_GET_SEQUENCE, cgs)) + if (igt_ioctl(fd, LOCAL_DRM_IOCTL_CRTC_GET_SEQUENCE, cgs)) err = -errno; return err; } -static int crtc_queue_sequence(int fd, struct drm_crtc_queue_sequence *cqs) +static int crtc_queue_sequence(int fd, struct local_drm_crtc_queue_sequence *cqs) { int err; err = 0; - if (igt_ioctl(fd, DRM_IOCTL_CRTC_QUEUE_SEQUENCE, cqs)) + if (igt_ioctl(fd, LOCAL_DRM_IOCTL_CRTC_QUEUE_SEQUENCE, cqs)) err = -errno; return err; } @@ -147,11 +175,11 @@ static void run_test(data_t *data, int fd, void (*testfunc)(data_t *, int, int)) nchildren); if (data->flags & BUSY) { - struct drm_crtc_queue_sequence cqs; + struct local_drm_crtc_queue_sequence cqs; memset(&cqs, 0, sizeof(cqs)); cqs.crtc_id = data->crtc_id; - cqs.flags = DRM_CRTC_SEQUENCE_RELATIVE | DRM_CRTC_SEQUENCE_FIRST_PIXEL_OUT; + cqs.flags = LOCAL_DRM_CRTC_SEQUENCE_RELATIVE; cqs.sequence = 120 + 12; igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0); } @@ -183,7 +211,7 @@ static void run_test(data_t *data, int fd, void (*testfunc)(data_t *, int, int)) static void sequence_get(data_t *data, int fd, int nchildren) { - struct drm_crtc_get_sequence cgs; + struct local_drm_crtc_get_sequence cgs; struct timespec start, end; unsigned long sq, count = 0; @@ -206,8 +234,8 @@ static void sequence_get(data_t *data, int fd, int nchildren) static void sequence_queue(data_t *data, int fd, int nchildren) { - struct drm_crtc_get_sequence cgs_start, cgs_end; - struct drm_crtc_queue_sequence cqs; + struct local_drm_crtc_get_sequence cgs_start, cgs_end; + struct local_drm_crtc_queue_sequence cqs; unsigned long target; int total = 120 / nchildren; int n; @@ -221,14 +249,14 @@ static void sequence_queue(data_t *data, int fd, int nchildren) for (n = 0; n < total; n++) { memset(&cqs, 0, sizeof(cqs)); cqs.crtc_id = data->crtc_id; - cqs.flags = DRM_CRTC_SEQUENCE_FIRST_PIXEL_OUT; + cqs.flags = 0; cqs.sequence = target; igt_assert_eq(crtc_queue_sequence(fd, &cqs), 0); igt_assert_eq(cqs.sequence, target); } for (n = 0; n < total; n++) { - struct drm_event_crtc_sequence ev; + struct local_drm_event_crtc_sequence ev; igt_assert_eq(read(fd, &ev, sizeof(ev)), sizeof(ev)); igt_assert_eq(ev.sequence, target); } |