summaryrefslogtreecommitdiff
path: root/tests/gem_exec_whisper.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_exec_whisper.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_exec_whisper.c')
-rw-r--r--tests/gem_exec_whisper.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/tests/gem_exec_whisper.c b/tests/gem_exec_whisper.c
index eeaa21f1..cd7fd6bb 100644
--- a/tests/gem_exec_whisper.c
+++ b/tests/gem_exec_whisper.c
@@ -395,35 +395,25 @@ static void whisper(int fd, unsigned engine, unsigned flags)
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" : "");