aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Packard2017-07-01 02:43:15 -0500
committerDave Airlie2017-12-17 18:04:02 -0600
commitd4331dda5b5969922c4f1e3ad6d53f23becb91ab (patch)
treef6ee7cae925d839993c7e23acc2d185fe2a9073c /xf86drm.c
parentc4171535389d72e9135c9615cecd07b346fd6d7e (diff)
downloadexternal-libgbm-d4331dda5b5969922c4f1e3ad6d53f23becb91ab.tar.gz
external-libgbm-d4331dda5b5969922c4f1e3ad6d53f23becb91ab.tar.xz
external-libgbm-d4331dda5b5969922c4f1e3ad6d53f23becb91ab.zip
drm: Add CrtcGetSequence and CrtcQueueSequence IOCTLs [v2]
These provide a crtc-id based interface to get the current sequence (frame) number and to queue an event to be delivered at a specific sequence. v2: Remove FIRST_PIXEL_OUT flag. This has been removed from the proposed kernel API Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'xf86drm.c')
-rw-r--r--xf86drm.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/xf86drm.c b/xf86drm.c
index deb76e4b..74b4e230 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -1695,6 +1695,43 @@ int drmUpdateDrawableInfo(int fd, drm_drawable_t handle,
1695 return 0; 1695 return 0;
1696} 1696}
1697 1697
1698int drmCrtcGetSequence(int fd, uint32_t crtcId, uint64_t *sequence, uint64_t *ns)
1699{
1700 struct drm_crtc_get_sequence get_seq;
1701 int ret;
1702
1703 memclear(get_seq);
1704 get_seq.crtc_id = crtcId;
1705 ret = drmIoctl(fd, DRM_IOCTL_CRTC_GET_SEQUENCE, &get_seq);
1706 if (ret)
1707 return ret;
1708
1709 if (sequence)
1710 *sequence = get_seq.sequence;
1711 if (ns)
1712 *ns = get_seq.sequence_ns;
1713 return 0;
1714}
1715
1716int drmCrtcQueueSequence(int fd, uint32_t crtcId, uint32_t flags, uint64_t sequence,
1717 uint64_t *sequence_queued, uint64_t user_data)
1718{
1719 struct drm_crtc_queue_sequence queue_seq;
1720 int ret;
1721
1722 memclear(queue_seq);
1723 queue_seq.crtc_id = crtcId;
1724 queue_seq.flags = flags;
1725 queue_seq.sequence = sequence;
1726 queue_seq.user_data = user_data;
1727
1728 ret = drmIoctl(fd, DRM_IOCTL_CRTC_QUEUE_SEQUENCE, &queue_seq);
1729 if (ret == 0 && sequence_queued)
1730 *sequence_queued = queue_seq.sequence;
1731
1732 return ret;
1733}
1734
1698/** 1735/**
1699 * Acquire the AGP device. 1736 * Acquire the AGP device.
1700 * 1737 *