diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_fence.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fence.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_fence.c b/drivers/gpu/drm/radeon/radeon_fence.c index 7b737b9339ad..2a59375dbe52 100644 --- a/drivers/gpu/drm/radeon/radeon_fence.c +++ b/drivers/gpu/drm/radeon/radeon_fence.c | |||
@@ -131,7 +131,7 @@ int radeon_fence_emit(struct radeon_device *rdev, | |||
131 | */ | 131 | */ |
132 | void radeon_fence_process(struct radeon_device *rdev, int ring) | 132 | void radeon_fence_process(struct radeon_device *rdev, int ring) |
133 | { | 133 | { |
134 | uint64_t seq, last_seq; | 134 | uint64_t seq, last_seq, last_emitted; |
135 | unsigned count_loop = 0; | 135 | unsigned count_loop = 0; |
136 | bool wake = false; | 136 | bool wake = false; |
137 | 137 | ||
@@ -158,13 +158,15 @@ void radeon_fence_process(struct radeon_device *rdev, int ring) | |||
158 | */ | 158 | */ |
159 | last_seq = atomic64_read(&rdev->fence_drv[ring].last_seq); | 159 | last_seq = atomic64_read(&rdev->fence_drv[ring].last_seq); |
160 | do { | 160 | do { |
161 | last_emitted = rdev->fence_drv[ring].sync_seq[ring]; | ||
161 | seq = radeon_fence_read(rdev, ring); | 162 | seq = radeon_fence_read(rdev, ring); |
162 | seq |= last_seq & 0xffffffff00000000LL; | 163 | seq |= last_seq & 0xffffffff00000000LL; |
163 | if (seq < last_seq) { | 164 | if (seq < last_seq) { |
164 | seq += 0x100000000LL; | 165 | seq &= 0xffffffff; |
166 | seq |= last_emitted & 0xffffffff00000000LL; | ||
165 | } | 167 | } |
166 | 168 | ||
167 | if (seq == last_seq) { | 169 | if (seq <= last_seq || seq > last_emitted) { |
168 | break; | 170 | break; |
169 | } | 171 | } |
170 | /* If we loop over we don't want to return without | 172 | /* If we loop over we don't want to return without |