static igt_pipe_crc_t * pipe_crc_new(enum pipe pipe, enum intel_pipe_crc_source source, int flags) { igt_pipe_crc_t *pipe_crc; char buf[128]; igt_install_exit_handler(pipe_crc_exit_handler); pipe_crc = calloc(1, sizeof(struct _igt_pipe_crc)); pipe_crc->ctl_fd = igt_debugfs_open("i915_display_crc_ctl", O_WRONLY); igt_assert(pipe_crc->ctl_fd != -1); sprintf(buf, "i915_pipe_%s_crc", kmstest_pipe_name(pipe)); pipe_crc->crc_fd = igt_debugfs_open(buf, flags); igt_assert(pipe_crc->crc_fd != -1); pipe_crc->line_len = PIPE_CRC_LINE_LEN; pipe_crc->buffer_len = PIPE_CRC_BUFFER_LEN; pipe_crc->pipe = pipe; pipe_crc->source = source; pipe_crc->flags = flags; return pipe_crc; }
static void set_termio_mode(void) { struct termios tio; /* don't attempt to set terminal attributes if not in the foreground * process group */ if (getpgrp() != tcgetpgrp(STDOUT_FILENO)) return; tio_fd = dup(STDIN_FILENO); tcgetattr(tio_fd, &saved_tio); igt_install_exit_handler(restore_termio_mode); tio = saved_tio; tio.c_lflag &= ~(ICANON | ECHO); tcsetattr(tio_fd, TCSANOW, &tio); }
/** * igt_disable_prefault: * * Disable prefaulting in certain gem ioctls through the debugfs interface. As * usual this installs an exit handler to clean up and re-enable prefaulting * even when the test exited abnormally. * * igt_enable_prefault() will enable normale operation again. */ void igt_disable_prefault(void) { igt_prefault_control(false); igt_install_exit_handler(enable_prefault_at_exit); }