diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-07-22 17:53:51 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-07-22 18:06:38 +0100 |
commit | b64d10cd9d9e9638acebae5e1199bd1be52aed39 (patch) | |
tree | 2d4b64f76c80a8ebca999ce450d5c6fb86a08bd7 /tests/gem_exec_nop.c | |
parent | 2e1275371efe83c34332bfcd75af3ba1c36c9fc1 (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_exec_nop.c')
-rw-r--r-- | tests/gem_exec_nop.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c index dc7f5143..9b892607 100644 --- a/tests/gem_exec_nop.c +++ b/tests/gem_exec_nop.c @@ -200,35 +200,25 @@ static void all(int fd, uint32_t handle, int timeout) 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" : ""); |