提交 695b95b8 编写于 作者: M Marcin Slusarz 提交者: Ben Skeggs

drm/nouveau: base fence timeout on time of emission

Wait loop can be interrupted by signal, so if signals are raised
periodically (e.g. SIGALRM) this loop may never finish. Use
emission time as a base for fence timeout.
Signed-off-by: NMarcin Slusarz <marcin.slusarz@gmail.com>
Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
上级 d58086de
...@@ -44,6 +44,7 @@ struct nouveau_fence { ...@@ -44,6 +44,7 @@ struct nouveau_fence {
uint32_t sequence; uint32_t sequence;
bool signalled; bool signalled;
unsigned long timeout;
void (*work)(void *priv, bool signalled); void (*work)(void *priv, bool signalled);
void *priv; void *priv;
...@@ -172,6 +173,7 @@ nouveau_fence_emit(struct nouveau_fence *fence) ...@@ -172,6 +173,7 @@ nouveau_fence_emit(struct nouveau_fence *fence)
} }
OUT_RING (chan, fence->sequence); OUT_RING (chan, fence->sequence);
FIRE_RING(chan); FIRE_RING(chan);
fence->timeout = jiffies + 3 * DRM_HZ;
return 0; return 0;
} }
...@@ -230,7 +232,8 @@ __nouveau_fence_signalled(void *sync_obj, void *sync_arg) ...@@ -230,7 +232,8 @@ __nouveau_fence_signalled(void *sync_obj, void *sync_arg)
int int
__nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr) __nouveau_fence_wait(void *sync_obj, void *sync_arg, bool lazy, bool intr)
{ {
unsigned long timeout = jiffies + (3 * DRM_HZ); struct nouveau_fence *fence = nouveau_fence(sync_obj);
unsigned long timeout = fence->timeout;
unsigned long sleep_time = NSEC_PER_MSEC / 1000; unsigned long sleep_time = NSEC_PER_MSEC / 1000;
ktime_t t; ktime_t t;
int ret = 0; int ret = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册