mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-11 16:32:58 +00:00
lib: add igt_pipe_crc_check
No need to duplicate this all over the place. Reviewed-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -205,6 +205,24 @@ static void pipe_crc_exit_handler(int sig)
|
||||
igt_pipe_crc_reset();
|
||||
}
|
||||
|
||||
void igt_pipe_crc_check(igt_debugfs_t *debugfs)
|
||||
{
|
||||
const char *cmd = "pipe A none";
|
||||
FILE *ctl;
|
||||
size_t written;
|
||||
int ret;
|
||||
|
||||
ctl = igt_debugfs_fopen(debugfs, "i915_display_crc_ctl", "r+");
|
||||
igt_require_f(ctl,
|
||||
"No display_crc_ctl found, kernel too old\n");
|
||||
written = fwrite(cmd, 1, strlen(cmd), ctl);
|
||||
ret = fflush(ctl);
|
||||
igt_require_f((written == strlen(cmd) && ret == 0) || errno != ENODEV,
|
||||
"CRCs not supported on this platform\n");
|
||||
|
||||
fclose(ctl);
|
||||
}
|
||||
|
||||
igt_pipe_crc_t *
|
||||
igt_pipe_crc_new(igt_debugfs_t *debugfs, int drm_fd, enum pipe pipe,
|
||||
enum intel_pipe_crc_source source)
|
||||
|
||||
@@ -70,6 +70,7 @@ bool igt_crc_is_null(igt_crc_t *crc);
|
||||
bool igt_crc_equal(igt_crc_t *a, igt_crc_t *b);
|
||||
char *igt_crc_to_string(igt_crc_t *crc);
|
||||
|
||||
void igt_pipe_crc_check(igt_debugfs_t *debugfs);
|
||||
igt_pipe_crc_t *
|
||||
igt_pipe_crc_new(igt_debugfs_t *debugfs, int drm_fd, enum pipe pipe,
|
||||
enum intel_pipe_crc_source source);
|
||||
|
||||
Reference in New Issue
Block a user