[Mesa-dev] [PATCH 04/18] winsys/amdgpu: avoid ioctl call when fence_wait is called without timeout
Nicolai Hähnle
nhaehnle at gmail.com
Mon May 9 23:21:22 UTC 2016
From: Nicolai Hähnle <nicolai.haehnle at amd.com>
When user fences are used, we don't need the kernel for polling.
---
src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index 419523b..075d791 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -99,10 +99,17 @@ bool amdgpu_fence_wait(struct pipe_fence_handle *fence, uint64_t timeout,
return false;
user_fence_cpu = rfence->user_fence_cpu_address;
- if (user_fence_cpu && *user_fence_cpu >= rfence->fence.fence) {
- rfence->signalled = true;
- return true;
+ if (user_fence_cpu) {
+ if (*user_fence_cpu >= rfence->fence.fence) {
+ rfence->signalled = true;
+ return true;
+ }
+
+ /* No timeout, just query: no need for the ioctl. */
+ if (!absolute && !timeout)
+ return false;
}
+
/* Now use the libdrm query. */
r = amdgpu_cs_query_fence_status(&rfence->fence,
abs_timeout,
--
2.7.4
More information about the mesa-dev
mailing list