summaryrefslogtreecommitdiff
path: root/tests/gem_sync.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-07-22 17:53:51 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2016-07-22 18:06:38 +0100
commitb64d10cd9d9e9638acebae5e1199bd1be52aed39 (patch)
tree2d4b64f76c80a8ebca999ce450d5c6fb86a08bd7 /tests/gem_sync.c
parent2e1275371efe83c34332bfcd75af3ba1c36c9fc1 (diff)
lib/sysfs: Provide a convenience function for reading a bool
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/gem_sync.c')
-rw-r--r--tests/gem_sync.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/tests/gem_sync.c b/tests/gem_sync.c
index 44b2378c..2a80efc4 100644
--- a/tests/gem_sync.c
+++ b/tests/gem_sync.c
@@ -693,35 +693,25 @@ store_all(int fd, int num_children)
static void print_welcome(int fd)
{
bool active;
- char *str;
int dir;
dir = igt_sysfs_open_parameters(fd);
if (dir < 0)
return;
- str = igt_sysfs_get(dir, "enable_guc_submission");
- active = str && atoi(str) > 0;
- free(str);
-
+ active = igt_sysfs_get_boolean(dir, "enable_guc_submission");
if (active) {
igt_info("Using GuC submission\n");
goto out;
}
- str = igt_sysfs_get(dir, "enable_execlists");
- active = str && atoi(str) > 0;
- free(str);
-
+ active = igt_sysfs_get_boolean(dir, "enable_execlists");
if (active) {
igt_info("Using Execlists submission\n");
goto out;
}
- str = igt_sysfs_get(dir, "semaphores");
- active = str && atoi(str) > 0;
- free(str);
-
+ active = igt_sysfs_get_boolean(dir, "semaphores");
igt_info("Using Legacy submission %s\n",
active ? ", with semaphores" : "");