Commit f8308898 authored by Andrey Grodzovsky's avatar Andrey Grodzovsky Committed by Alex Deucher

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: default avatarAndrey Grodzovsky <andrey.grodzovsky@amd.com>
Reviewed-by: default avatarNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 2fac0f53
...@@ -5207,11 +5207,16 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, ...@@ -5207,11 +5207,16 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
abo = gem_to_amdgpu_bo(fb->obj[0]); abo = gem_to_amdgpu_bo(fb->obj[0]);
/* Wait for all fences on this FB */ /*
* Wait for all fences on this FB. Do limited wait to avoid
* deadlock during GPU reset when this fence will not signal
* but we hold reservation lock for the BO.
*/
r = reservation_object_wait_timeout_rcu(abo->tbo.resv, true, r = reservation_object_wait_timeout_rcu(abo->tbo.resv, true,
false, false,
MAX_SCHEDULE_TIMEOUT); msecs_to_jiffies(5000));
WARN_ON(r < 0); if (unlikely(r <= 0))
DRM_ERROR("Waiting for fences timed out or interrupted!");
/* /*
* TODO This might fail and hence better not used, wait * 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,10 +5225,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
* blocking commit to as per framework helpers * blocking commit to as per framework helpers
*/ */
r = amdgpu_bo_reserve(abo, true); r = amdgpu_bo_reserve(abo, true);
if (unlikely(r != 0)) { if (unlikely(r != 0))
DRM_ERROR("failed to reserve buffer before flip\n"); DRM_ERROR("failed to reserve buffer before flip\n");
WARN_ON(1);
}
amdgpu_bo_get_tiling_flags(abo, &tiling_flags); amdgpu_bo_get_tiling_flags(abo, &tiling_flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment