diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-03-14 12:27:39 +0200 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-08-12 18:44:12 +0100 |
commit | 5547010c29a332ccc861652db3abf726f880985a (patch) | |
tree | 11c59ba90ae48bc7c8285a80e7934164067af705 /lib/sw_sync.c | |
parent | a49a3a6cdbc4949c0ae8df5f3d8c3e476aefdea1 (diff) |
lib/sw_sync: Fix querying fence status
To query the fence status, and only the fence status, you only need to
pass .num_fences = 0.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Petri Latvala <petri.latvala@intel.com>
Acked-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'lib/sw_sync.c')
-rw-r--r-- | lib/sw_sync.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/sw_sync.c b/lib/sw_sync.c index f20860331..d671923c9 100644 --- a/lib/sw_sync.c +++ b/lib/sw_sync.c @@ -206,19 +206,12 @@ int sync_fence_count_status(int fd, int status) int sync_fence_status(int fence) { - struct sync_fence_info fence_info; - struct sync_file_info file_info = { - .sync_fence_info = to_user_pointer(&fence_info), - .num_fences = 1, - }; + struct sync_file_info info = { }; - if (ioctl(fence, SYNC_IOC_FILE_INFO, &file_info)) + if (ioctl(fence, SYNC_IOC_FILE_INFO, &info)) return -errno; - if (file_info.num_fences != 1) - return -EINVAL; - - return fence_info.status; + return info.status; } static void modprobe(const char *driver) |