return true;
}
+static void igt_pipe_crc_pipe_off(int fd, enum pipe pipe)
+{
+ char buf[32];
+
+ sprintf(buf, "pipe %c none", pipe_name(pipe));
+ write(fd, buf, strlen(buf));
+}
+
+static void igt_pipe_crc_reset(void)
+{
+ igt_debugfs_t debugfs;
+ int fd;
+
+ igt_debugfs_init(&debugfs);
+ fd = igt_debugfs_open(&debugfs, "i915_display_crc_ctl", O_WRONLY);
+
+ igt_pipe_crc_pipe_off(fd, PIPE_A);
+ igt_pipe_crc_pipe_off(fd, PIPE_B);
+ igt_pipe_crc_pipe_off(fd, PIPE_C);
+
+ close(fd);
+}
+
+static void pipe_crc_exit_handler(int sig)
+{
+ igt_pipe_crc_reset();
+}
+
igt_pipe_crc_t *
igt_pipe_crc_new(igt_debugfs_t *debugfs, int drm_fd, enum pipe pipe,
enum intel_pipe_crc_source source)
igt_pipe_crc_t *pipe_crc;
char buf[128];
+ do_or_die(igt_install_exit_handler(pipe_crc_exit_handler));
+
pipe_crc = calloc(1, sizeof(struct _igt_pipe_crc));
pipe_crc->ctl_fd = igt_debugfs_open(debugfs,
return pipe_crc;
}
-static void igt_pipe_crc_pipe_off(int fd, enum pipe pipe)
-{
- char buf[32];
-
- sprintf(buf, "pipe %c none", pipe_name(pipe));
- write(fd, buf, strlen(buf));
-}
-
-/*
- * Turn off everything
- */
-void igt_pipe_crc_reset(void)
-{
- igt_debugfs_t debugfs;
- int fd;
-
- igt_debugfs_init(&debugfs);
- fd = igt_debugfs_open(&debugfs, "i915_display_crc_ctl", O_WRONLY);
-
- igt_pipe_crc_pipe_off(fd, PIPE_A);
- igt_pipe_crc_pipe_off(fd, PIPE_B);
- igt_pipe_crc_pipe_off(fd, PIPE_C);
-
- close(fd);
-}
-
void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc)
{
if (!pipe_crc)
igt_pipe_crc_t *
igt_pipe_crc_new(igt_debugfs_t *debugfs, int drm_fd, enum pipe pipe,
enum intel_pipe_crc_source source);
-void igt_pipe_crc_reset(void);
void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc);
bool igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc);
igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
}
-static void exit_handler(int sig)
-{
- igt_pipe_crc_reset();
-}
-
static void create_cursor_fb(data_t *data,
enum cursor_type cursor_type,
double r, double g, double b, double a)
data.drm_fd = drm_open_any();
do_or_die(igt_set_vt_graphics_mode());
- do_or_die(igt_install_exit_handler(exit_handler));
igt_debugfs_init(&data.debugfs);
data.ctl = igt_debugfs_fopen(&data.debugfs,
run_test(&data, BLACK_INVISIBLE, false);
igt_fixture {
- igt_pipe_crc_reset();
display_fini(&data);
fclose(data.ctl);
}