aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2017-04-03 23:26:24 -0400
committerDave Airlie <airlied@redhat.com>2017-06-13 22:10:22 -0400
commite9083420bbacce27e43d418064d0d2dfb4b37aaa (patch)
treea539c575bae132fa2cc992ee53da4c04909e7fe1 /include/uapi
parentc9f0726ff360cf75aaafd326e439e9234630aee9 (diff)
drm: introduce sync objects (v4)
Sync objects are new toplevel drm object, that contain a pointer to a fence. This fence can be updated via command submission ioctls via drivers. There is also a generic wait obj API modelled on the vulkan wait API (with code modelled on some amdgpu code). These objects can be converted to an opaque fd that can be passes between processes. v2: rename reference/unreference to put/get (Chris) fix leaked reference (David Zhou) drop mutex in favour of cmpxchg (Chris) v3: cleanups from danvet, rebase on drm_fops rename check fd_flags is 0 in ioctls. v4: export find/free, change replace fence to take a syncobj. In order to support lookup first, replace later semantics which seem in the end to be cleaner. Reviewed-by: Sean Paul <seanpaul@chromium.org> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/drm/drm.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/uapi/drm/drm.h b/include/uapi/drm/drm.h
index 42d9f64ce416..96c5c789e73d 100644
--- a/include/uapi/drm/drm.h
+++ b/include/uapi/drm/drm.h
@@ -648,6 +648,7 @@ struct drm_gem_open {
648#define DRM_CAP_ADDFB2_MODIFIERS 0x10 648#define DRM_CAP_ADDFB2_MODIFIERS 0x10
649#define DRM_CAP_PAGE_FLIP_TARGET 0x11 649#define DRM_CAP_PAGE_FLIP_TARGET 0x11
650#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 650#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12
651#define DRM_CAP_SYNCOBJ 0x13
651 652
652/** DRM_IOCTL_GET_CAP ioctl argument type */ 653/** DRM_IOCTL_GET_CAP ioctl argument type */
653struct drm_get_cap { 654struct drm_get_cap {
@@ -697,6 +698,24 @@ struct drm_prime_handle {
697 __s32 fd; 698 __s32 fd;
698}; 699};
699 700
701struct drm_syncobj_create {
702 __u32 handle;
703 __u32 flags;
704};
705
706struct drm_syncobj_destroy {
707 __u32 handle;
708 __u32 pad;
709};
710
711struct drm_syncobj_handle {
712 __u32 handle;
713 __u32 flags;
714
715 __s32 fd;
716 __u32 pad;
717};
718
700#if defined(__cplusplus) 719#if defined(__cplusplus)
701} 720}
702#endif 721#endif
@@ -815,6 +834,11 @@ extern "C" {
815#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob) 834#define DRM_IOCTL_MODE_CREATEPROPBLOB DRM_IOWR(0xBD, struct drm_mode_create_blob)
816#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob) 835#define DRM_IOCTL_MODE_DESTROYPROPBLOB DRM_IOWR(0xBE, struct drm_mode_destroy_blob)
817 836
837#define DRM_IOCTL_SYNCOBJ_CREATE DRM_IOWR(0xBF, struct drm_syncobj_create)
838#define DRM_IOCTL_SYNCOBJ_DESTROY DRM_IOWR(0xC0, struct drm_syncobj_destroy)
839#define DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD DRM_IOWR(0xC1, struct drm_syncobj_handle)
840#define DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE DRM_IOWR(0xC2, struct drm_syncobj_handle)
841
818/** 842/**
819 * Device specific ioctls should only be in their respective headers 843 * Device specific ioctls should only be in their respective headers
820 * The device specific ioctl range is from 0x40 to 0x9f. 844 * The device specific ioctl range is from 0x40 to 0x9f.