summaryrefslogtreecommitdiff
path: root/lib/igt_vgem.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-06-18 00:42:19 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-06-18 21:39:33 +0100
commitc344044ab681566d36a49a0456666a32bac3419a (patch)
tree2d077fe9caa9d80e90a2cf9f09eed63c6f0c3ae8 /lib/igt_vgem.h
parent7ce63894854d8dafc0cf1f5450e5c1d32ac18150 (diff)
igt: Add basic exercise of vGEM
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_vgem.h')
-rw-r--r--lib/igt_vgem.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/igt_vgem.h b/lib/igt_vgem.h
new file mode 100644
index 00000000..9e4a55e8
--- /dev/null
+++ b/lib/igt_vgem.h
@@ -0,0 +1,42 @@
+/*
+ * Copyright © 2016 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+#ifndef IGT_VGEM_H
+#define IGT_VGEM_H
+
+#include <stdint.h>
+
+struct vgem_bo {
+ uint32_t handle;
+ uint32_t width, height;
+ uint32_t bpp, pitch;
+ uint64_t size;
+};
+
+int __vgem_create(int fd, struct vgem_bo *bo);
+void vgem_create(int fd, struct vgem_bo *bo);
+
+void *__vgem_mmap(int fd, struct vgem_bo *bo, unsigned prot);
+void *vgem_mmap(int fd, struct vgem_bo *bo, unsigned prot);
+
+#endif /* IGT_VGEM_H */