diff options
Diffstat (limited to 'src/utils.c')
-rw-r--r-- | src/utils.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils.c b/src/utils.c index 98de5f0..322d7d9 100644 --- a/src/utils.c +++ b/src/utils.c @@ -3,6 +3,7 @@ #include <time.h> #include <string.h> #include <stdio.h> +#include <unistd.h> double clock_get_monotonic_seconds(void) { struct timespec ts; @@ -103,3 +104,12 @@ bool gl_get_gpu_info(Display *dpy, gsr_gpu_info *info) { gsr_egl_unload(&gl); return supported; } + +bool gsr_get_valid_card_path(char *output) { + for(int i = 0; i < 10; ++i) { + sprintf(output, "/dev/dri/card%d", i); + if(access(output, F_OK) == 0) + return true; + } + return false; +} |