drm/radeon: fix radeon_fence_wait_empty_locked
authorChristian König <christian.koenig@amd.com>
Tue, 5 Nov 2013 13:09:54 +0000 (14:09 +0100)
committerDave Airlie <airlied@redhat.com>
Wed, 6 Nov 2013 03:40:59 +0000 (13:40 +1000)
Don't block forever if there is nothing to wait for.

Signed-off-by: Christian König <christian.koenig@amd.com>
Tested-by: Rafa? Mi?ecki <zajec5@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_fence.c

index b8f68b2c47d4ae7f6302a5c47aa6f9d3e282c2bc..281d14c22a47beb3eac3747f09559155ecfa427b 100644 (file)
@@ -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)