From adb28fd71d21175f047d7ed4cc3e4683a146b57b Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 12 Mar 2014 16:53:47 +0100 Subject: lib: move prefault helpers to igt_debugfs.c This way all debugfs library code is in one place, ready for some api documentation care. Signed-off-by: Daniel Vetter --- lib/drmtest.c | 38 -------------------------------------- 1 file changed, 38 deletions(-) (limited to 'lib/drmtest.c') diff --git a/lib/drmtest.c b/lib/drmtest.c index a5aac4dc..78b9999d 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -425,44 +425,6 @@ void igt_cleanup_aperture_trashers(void) 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; -- cgit v1.2.3