summaryrefslogtreecommitdiff
path: root/lib/drmtest.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-22 19:21:26 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-03-22 19:39:37 +0100
commitbff22f7317a39605d53cf142e2c0f5c424d9c12c (patch)
tree1c2604f61a157999171dfe23954e3c8b8caa0fda /lib/drmtest.h
parent7754c4dd769e61ea57bf3e4ab635099b47aa6223 (diff)
lib: Move non-register things out of intel-gpu-tools.h
Right now almost everything in there concerns itself with register access. Move everything else out (into drmtest.h for lack of better place) to prepare for api documentation. Also rename intel_drm.c to intel_os.c since it contains OS, not drm abstractions. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib/drmtest.h')
-rw-r--r--lib/drmtest.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 593f31b9..ed6040f7 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -47,6 +47,19 @@
#include "ioctl_wrappers.h"
#include "igt_core.h"
+#ifdef ANDROID
+#ifndef HAVE_MMAP64
+extern void* __mmap2(void *, size_t, int, int, int, off_t);
+static inline void *mmap64(void *addr, size_t length, int prot, int flags,
+ int fd, off64_t offset)
+{
+ return __mmap2(addr, length, prot, flags, fd, offset >> 12);
+}
+#endif
+#endif
+
+#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0]))
+
int drm_get_card(void);
int drm_open_any(void);
int drm_open_any_render(void);
@@ -85,4 +98,8 @@ void igt_drop_root(void);
void igt_wait_for_keypress(void);
+/* sysinfo cross-arch wrappers from intel_os.c */
+uint64_t intel_get_total_ram_mb(void);
+uint64_t intel_get_total_swap_mb(void);
+
#endif /* DRMTEST_H */