free(trash_bos);
}
-#define PREFAULT_DEBUGFS "/sys/module/i915/parameters/prefault_disable"
-static void igt_prefault_control(bool enable)
-{
- const char *name = PREFAULT_DEBUGFS;
- int fd;
- char buf[2] = {'Y', 'N'};
- int index;
-
- fd = open(name, O_RDWR);
- igt_require(fd >= 0);
-
- if (enable)
- index = 1;
- else
- index = 0;
-
- igt_require(write(fd, &buf[index], 1) == 1);
-
- close(fd);
-}
-
-static void enable_prefault_at_exit(int sig)
-{
- igt_enable_prefault();
-}
-
-void igt_disable_prefault(void)
-{
- igt_prefault_control(false);
-
- igt_install_exit_handler(enable_prefault_at_exit);
-}
-
-void igt_enable_prefault(void)
-{
- igt_prefault_control(true);
-}
-
void igt_system_suspend_autoresume(void)
{
int ret;
/* set vt into graphics mode, required to prevent fbcon from interfering */
void igt_set_vt_graphics_mode(void);
-/* prefault disabling, needs the corresponding debugfs interface */
-void igt_disable_prefault(void);
-void igt_enable_prefault(void);
-
/* suspend and auto-resume system */
void igt_system_suspend_autoresume(void);
#include "igt_display.h"
#include "igt_debugfs.h"
+/*
+ * General debugfs helpers
+ */
int igt_debugfs_init(igt_debugfs_t *debugfs)
{
const char *path = "/sys/kernel/debug";
igt_assert(nbytes == strlen(data) + 1);
close(fd);
}
+
+/*
+ * Prefault control
+ */
+
+#define PREFAULT_DEBUGFS "/sys/module/i915/parameters/prefault_disable"
+static void igt_prefault_control(bool enable)
+{
+ const char *name = PREFAULT_DEBUGFS;
+ int fd;
+ char buf[2] = {'Y', 'N'};
+ int index;
+
+ fd = open(name, O_RDWR);
+ igt_require(fd >= 0);
+
+ if (enable)
+ index = 1;
+ else
+ index = 0;
+
+ igt_require(write(fd, &buf[index], 1) == 1);
+
+ close(fd);
+}
+
+static void enable_prefault_at_exit(int sig)
+{
+ igt_enable_prefault();
+}
+
+void igt_disable_prefault(void)
+{
+ igt_prefault_control(false);
+
+ igt_install_exit_handler(enable_prefault_at_exit);
+}
+
+void igt_enable_prefault(void)
+{
+ igt_prefault_control(true);
+}
void igt_drop_caches_set(uint64_t val);
+/*
+ * Prefault control
+ */
+
+void igt_disable_prefault(void);
+void igt_enable_prefault(void);
+
+
#endif /* __IGT_DEBUGFS_H__ */
#include "drmtest.h"
#include "intel_chipset.h"
#include "intel_gpu_tools.h"
+#include "igt_debugfs.h"
/* Testcase: Submit patches with relocations in memory that will fault
*
#include "drm.h"
#include "i915_drm.h"
#include "drmtest.h"
+#include "igt_debugfs.h"
static int OBJECT_SIZE = 16*1024*1024;