public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] lib/sw_sync: Fix querying fence status
@ 2019-03-13 17:36 Chris Wilson
  2019-03-13 18:33 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
  2019-03-14  1:19 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2019-03-13 17:36 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Petri Latvala

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>
---
 lib/sw_sync.c | 13 +++----------
 1 file 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)
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-14  1:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-13 17:36 [igt-dev] [PATCH i-g-t] lib/sw_sync: Fix querying fence status Chris Wilson
2019-03-13 18:33 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-03-14  1:19 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox