summaryrefslogtreecommitdiff
path: root/src/egl/main/eglsync.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main/eglsync.h')
-rw-r--r--src/egl/main/eglsync.h42
1 files changed, 25 insertions, 17 deletions
diff --git a/src/egl/main/eglsync.h b/src/egl/main/eglsync.h
index 052d016681..a0025237e7 100644
--- a/src/egl/main/eglsync.h
+++ b/src/egl/main/eglsync.h
@@ -34,13 +34,35 @@ _eglGetSyncAttribKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
/**
- * Link a sync to a display and return the handle of the link.
+ * Increment reference count for the sync.
+ */
+static INLINE _EGLSync *
+_eglGetSync(_EGLSync *sync)
+{
+ if (sync)
+ _eglGetResource(&sync->Resource);
+ return sync;
+}
+
+
+/**
+ * Decrement reference count for the sync.
+ */
+static INLINE EGLBoolean
+_eglPutSync(_EGLSync *sync)
+{
+ return (sync) ? _eglPutResource(&sync->Resource) : EGL_FALSE;
+}
+
+
+/**
+ * Link a sync to its display and return the handle of the link.
* The handle can be passed to client directly.
*/
static INLINE EGLSyncKHR
-_eglLinkSync(_EGLSync *sync, _EGLDisplay *dpy)
+_eglLinkSync(_EGLSync *sync)
{
- _eglLinkResource(&sync->Resource, _EGL_RESOURCE_SYNC, dpy);
+ _eglLinkResource(&sync->Resource, _EGL_RESOURCE_SYNC);
return (EGLSyncKHR) sync;
}
@@ -81,20 +103,6 @@ _eglGetSyncHandle(_EGLSync *sync)
}
-/**
- * Return true if the sync is linked to a display.
- *
- * The link is considered a reference to the sync (the display is owning the
- * sync). Drivers should not destroy a sync when it is linked.
- */
-static INLINE EGLBoolean
-_eglIsSyncLinked(_EGLSync *sync)
-{
- _EGLResource *res = (_EGLResource *) sync;
- return (res && _eglIsResourceLinked(res));
-}
-
-
#endif /* EGL_KHR_reusable_sync */