aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
diff options
context:
space:
mode:
authorChunming Zhou <David1.Zhou@amd.com>2016-03-30 23:07:14 -0400
committerAlex Deucher <alexander.deucher@amd.com>2016-04-01 10:08:39 -0400
commitfc387a0b183150b5beb953d740441f19b49a1fb3 (patch)
treec8a9c2bdecba1eca89b25db6c954fee462f9691a /drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
parentab7e9c137a85cf942c720498501d29719e61160c (diff)
drm/amdgpu: fence wait old rcu slot
since the rcu slot was initialized to be num_hw_submission, if command submission doesn't use scheduler, this limitation will be invalid like uvd test. Signed-off-by: Chunming Zhou <David1.Zhou@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
index 4303b447efe8..d81f1f4883a6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
@@ -121,7 +121,7 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct fence **f)
121{ 121{
122 struct amdgpu_device *adev = ring->adev; 122 struct amdgpu_device *adev = ring->adev;
123 struct amdgpu_fence *fence; 123 struct amdgpu_fence *fence;
124 struct fence **ptr; 124 struct fence *old, **ptr;
125 uint32_t seq; 125 uint32_t seq;
126 126
127 fence = kmem_cache_alloc(amdgpu_fence_slab, GFP_KERNEL); 127 fence = kmem_cache_alloc(amdgpu_fence_slab, GFP_KERNEL);
@@ -141,7 +141,11 @@ int amdgpu_fence_emit(struct amdgpu_ring *ring, struct fence **f)
141 /* This function can't be called concurrently anyway, otherwise 141 /* This function can't be called concurrently anyway, otherwise
142 * emitting the fence would mess up the hardware ring buffer. 142 * emitting the fence would mess up the hardware ring buffer.
143 */ 143 */
144 BUG_ON(rcu_dereference_protected(*ptr, 1)); 144 old = rcu_dereference_protected(*ptr, 1);
145 if (old && !fence_is_signaled(old)) {
146 DRM_INFO("rcu slot is busy\n");
147 fence_wait(old, false);
148 }
145 149
146 rcu_assign_pointer(*ptr, fence_get(&fence->base)); 150 rcu_assign_pointer(*ptr, fence_get(&fence->base));
147 151