diff options
author | Andrey Grodzovsky <andrey.grodzovsky@amd.com> | 2019-04-15 10:57:14 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-04-23 13:09:26 -0400 |
commit | f83088981a431f8ee13ebc442cfccbecb0ed95bf (patch) | |
tree | e835a67cbf8df16df638a6fa2b65f124238c4c8f /drivers/gpu/drm/amd | |
parent | 2fac0f53fe5921264c525a0439ee9baf0fe9ada1 (diff) |
drm/amd/display: Use a reasonable timeout for framebuffer fence waits
Patch '5edb0c9b Fix deadlock with display during hanged ring recovery'
was accidentaly removed during one of DALs code merges.
Signed-off-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd')
-rw-r--r-- | drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 36331e70fa83..a3dc7ab523de 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | |||
@@ -5207,11 +5207,16 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, | |||
5207 | 5207 | ||
5208 | abo = gem_to_amdgpu_bo(fb->obj[0]); | 5208 | abo = gem_to_amdgpu_bo(fb->obj[0]); |
5209 | 5209 | ||
5210 | /* Wait for all fences on this FB */ | 5210 | /* |
5211 | * Wait for all fences on this FB. Do limited wait to avoid | ||
5212 | * deadlock during GPU reset when this fence will not signal | ||
5213 | * but we hold reservation lock for the BO. | ||
5214 | */ | ||
5211 | r = reservation_object_wait_timeout_rcu(abo->tbo.resv, true, | 5215 | r = reservation_object_wait_timeout_rcu(abo->tbo.resv, true, |
5212 | false, | 5216 | false, |
5213 | MAX_SCHEDULE_TIMEOUT); | 5217 | msecs_to_jiffies(5000)); |
5214 | WARN_ON(r < 0); | 5218 | if (unlikely(r <= 0)) |
5219 | DRM_ERROR("Waiting for fences timed out or interrupted!"); | ||
5215 | 5220 | ||
5216 | /* | 5221 | /* |
5217 | * TODO This might fail and hence better not used, wait | 5222 | * TODO This might fail and hence better not used, wait |
@@ -5220,10 +5225,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, | |||
5220 | * blocking commit to as per framework helpers | 5225 | * blocking commit to as per framework helpers |
5221 | */ | 5226 | */ |
5222 | r = amdgpu_bo_reserve(abo, true); | 5227 | r = amdgpu_bo_reserve(abo, true); |
5223 | if (unlikely(r != 0)) { | 5228 | if (unlikely(r != 0)) |
5224 | DRM_ERROR("failed to reserve buffer before flip\n"); | 5229 | DRM_ERROR("failed to reserve buffer before flip\n"); |
5225 | WARN_ON(1); | ||
5226 | } | ||
5227 | 5230 | ||
5228 | amdgpu_bo_get_tiling_flags(abo, &tiling_flags); | 5231 | amdgpu_bo_get_tiling_flags(abo, &tiling_flags); |
5229 | 5232 | ||