From be7a7b8997a1c041ce42843e8290082fdb4f11f5 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 12 Jan 2015 16:11:16 -0500 Subject: drm/msm/atomic: fix issue with gnome-shell wayland The gnome-shell wayland compositor triggers a setcrtc with an fb that is still being rendered, triggering the call to _wait_fence_interruptable(). But a NULL timeout means "don't wait, return -EBUSY if not ready", which in turn causes the setcrtc to fail. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/msm_atomic.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index 2beef4e670d0..871aa2108dc6 100644 --- a/drivers/gpu/drm/msm/msm_atomic.c +++ b/drivers/gpu/drm/msm/msm_atomic.c @@ -178,6 +178,7 @@ int msm_atomic_commit(struct drm_device *dev, { int nplanes = dev->mode_config.num_total_plane; int ncrtcs = dev->mode_config.num_crtc; + struct timespec timeout; struct msm_commit *c; int i, ret; @@ -250,7 +251,9 @@ int msm_atomic_commit(struct drm_device *dev, return 0; } - ret = msm_wait_fence_interruptable(dev, c->fence, NULL); + jiffies_to_timespec(jiffies + msecs_to_jiffies(1000), &timeout); + + ret = msm_wait_fence_interruptable(dev, c->fence, &timeout); if (ret) { WARN_ON(ret); // TODO unswap state back? or?? commit_destroy(c); -- cgit v1.2.3