summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2018-06-18 15:00:22 +0200
committerThomas Hellstrom <thellstrom@vmware.com>2018-06-19 18:27:52 +0200
commit5817efe432217826dc2175148ac13226a1f42afd (patch)
treefa7e1d42d2272357257502d202a2108427633e08
parent57fa867b0f5d06c89ffda37ed1e741dacf2758fe (diff)
vmwgfx: Don't time out on fence waits
Never time out on fence waits, but instead print an error message and restart the wait. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Deepak Rawat <drawat@vmware.com>
-rw-r--r--vmwgfx_fence.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/vmwgfx_fence.c b/vmwgfx_fence.c
index 8f1b0d4..7b5314a 100644
--- a/vmwgfx_fence.c
+++ b/vmwgfx_fence.c
@@ -150,6 +150,24 @@ static bool vmw_fence_enable_signaling(struct dma_fence *f)
return true;
}
+static signed long vmw_fence_timeout_error(struct dma_fence *f,
+ signed long timeout)
+{
+ struct vmw_fence_obj *fence =
+ container_of(f, struct vmw_fence_obj, base);
+ struct vmw_fence_manager *fman = fman_from_fence(fence);
+ struct vmw_private *dev_priv = fman->dev_priv;
+ u32 *fifo_mem = dev_priv->mmio_virt;
+
+ DRM_ERROR("Fence timeout after %ld ticks. "
+ "Ignoring and restarting wait.\n", timeout);
+ DRM_ERROR("Fence seqno: %lu, Last signaled: %lu\n",
+ (unsigned long) f->seqno,
+ (unsigned long) vmw_mmio_read(fifo_mem + SVGA_FIFO_FENCE));
+
+ return timeout;
+};
+
struct vmwgfx_wait_cb {
struct dma_fence_cb base;
struct task_struct *task;
@@ -217,8 +235,11 @@ static long vmw_fence_wait(struct dma_fence *f, bool intr, signed long timeout)
break;
}
- if (ret == 0)
- break;
+ if (ret == 0) {
+ ret = vmw_fence_timeout_error(f, timeout);
+ if (ret == 0)
+ break;
+ }
spin_unlock(f->lock);