[PATCH] drm/radeon: fix radeon_fence_wait_empty_locked

Christian König deathsimple at vodafone.de
Tue Nov 5 05:09:54 PST 2013


From: Christian König <christian.koenig at amd.com>

Don't block forever if there is nothing to wait for.

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 drivers/gpu/drm/radeon/radeon_fence.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c
index b8f68b2..281d14c 100644
--- a/drivers/gpu/drm/radeon/radeon_fence.c
+++ b/drivers/gpu/drm/radeon/radeon_fence.c
@@ -510,6 +510,9 @@ int radeon_fence_wait_empty_locked(struct radeon_device *rdev, int ring)
 	int r;
 
 	seq[ring] = rdev->fence_drv[ring].sync_seq[ring];
+	if (!seq[ring])
+		return 0;
+
 	r = radeon_fence_wait_seq(rdev, seq, false, false);
 	if (r) {
 		if (r == -EDEADLK)
-- 
1.8.1.2



More information about the dri-devel mailing list