egl: replace _EGLDriver param with _EGLDisplay->Driver in _eglReleaseDisplayResources()
[mesa.git] / src / intel / common / gen_gem.h
index 8df2c249e4803ee82813e0db6e3a6f4f138b918b..cfcc59c20697d0f7df46c5ad04b37a982f4e2ce6 100644 (file)
 #ifndef GEN_GEM_H
 #define GEN_GEM_H
 
+#include <errno.h>
+#include <stdbool.h>
 #include <stdint.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
 
 static inline uint64_t
 gen_canonical_address(uint64_t v)
@@ -54,4 +58,20 @@ gen_48b_address(uint64_t v)
    return (uint64_t)(v << shift) >> shift;
 }
 
+/**
+ * Call ioctl, restarting if it is interupted
+ */
+static inline int
+gen_ioctl(int fd, unsigned long request, void *arg)
+{
+    int ret;
+
+    do {
+        ret = ioctl(fd, request, arg);
+    } while (ret == -1 && (errno == EINTR || errno == EAGAIN));
+    return ret;
+}
+
+bool gen_gem_supports_syncobj_wait(int fd);
+
 #endif /* GEN_GEM_H */