Mesa (staging/20.1): radeonsi: fix max syncobj wait timeout

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Sep 14 19:24:36 UTC 2020


Module: Mesa
Branch: staging/20.1
Commit: 56fb98d2e70fa49ddd41236e0e57dfb6554f65a9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=56fb98d2e70fa49ddd41236e0e57dfb6554f65a9

Author: Qiang Yu <yuq825 at gmail.com>
Date:   Thu Sep 10 10:08:41 2020 +0800

radeonsi: fix max syncobj wait timeout

syncobj wait takes int64_t timeout and won't clamp it
in kernel code, so we have to pass in INT64_MAX instead
of OS_TIMEOUT_INFINITE which is UINT64_MAX. Otherwise
syncobj wait with OS_TIMEOUT_INFINITE case just return
fail.

Fixes: c638301b42b "radeonsi: fix syncobj wait timeout"
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Signed-off-by: Qiang Yu <yuq825 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6676>
(cherry picked from commit ef980ac0c1cd65993ba0c1d20e1c09b45bfef99d)

---

 .pick_status.json                         | 2 +-
 src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 8292d73f48b..61758db444e 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -157,7 +157,7 @@
         "description": "radeonsi: fix max syncobj wait timeout",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "c638301b42bc6ea1a623c2a53646047197fb8030"
     },
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index 1088696c41c..f844a60cd1c 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -206,6 +206,9 @@ bool amdgpu_fence_wait(struct pipe_fence_handle *fence, uint64_t timeout,
 
    /* Handle syncobjs. */
    if (amdgpu_fence_is_syncobj(afence)) {
+      if (abs_timeout == OS_TIMEOUT_INFINITE)
+         abs_timeout = INT64_MAX;
+
       if (amdgpu_cs_syncobj_wait(afence->ws->dev, &afence->syncobj, 1,
                                  abs_timeout, 0, NULL))
          return false;



More information about the mesa-commit mailing list