Commit 42c4551a authored by Gerd Hoffmann's avatar Gerd Hoffmann

drm/qxl: more fence wait rework

Move qxl_io_notify_oom() call into wait condition.
That way the driver will call it again if one call
wasn't enough.

Also allows to remove the extra dma_fence_is_signaled()
check and the goto.

Fixes: 5a838e5d ("drm/qxl: simplify qxl_fence_wait")
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Link: http://patchwork.freedesktop.org/patch/msgid/20210217123213.2199186-3-kraxel@redhat.com
parent 26fe1f4c
...@@ -62,16 +62,12 @@ static long qxl_fence_wait(struct dma_fence *fence, bool intr, ...@@ -62,16 +62,12 @@ static long qxl_fence_wait(struct dma_fence *fence, bool intr,
qdev = container_of(fence->lock, struct qxl_device, release_lock); qdev = container_of(fence->lock, struct qxl_device, release_lock);
if (dma_fence_is_signaled(fence))
goto signaled;
qxl_io_notify_oom(qdev);
if (!wait_event_timeout(qdev->release_event, if (!wait_event_timeout(qdev->release_event,
dma_fence_is_signaled(fence), (dma_fence_is_signaled(fence) ||
(qxl_io_notify_oom(qdev), 0)),
timeout)) timeout))
return 0; return 0;
signaled:
cur = jiffies; cur = jiffies;
if (time_after(cur, end)) if (time_after(cur, end))
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment