All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/5] drm/amd/display: wait for fence without holding reservation lock
@ 2019-04-16 18:23 Andrey Grodzovsky
  2019-04-16 18:23 ` [PATCH v4 2/5] drm/amd/display: Use a reasonable timeout for framebuffer fence waits Andrey Grodzovsky
       [not found] ` <1555438986-18303-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 2 replies; 12+ messages in thread
From: Andrey Grodzovsky @ 2019-04-16 18:23 UTC (permalink / raw)
  To: dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	eric-WhKQ6XTQaPysTnJN9+BGXg,
	etnaviv-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	ckoenig.leichtzumerken-Re5JQEeQqe8AvxtiuMwx3w
  Cc: Nicholas.Kazlauskas-5C7GfCeVMHo, Christian König

From: Christian König <ckoenig.leichtzumerken@gmail.com>

Don't block others while waiting for the fences to finish, concurrent
submission is perfectly valid in this case and holding the lock can
prevent killed applications from terminating.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 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 380a7f9..ad4f0e5 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4814,23 +4814,26 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state,
 			continue;
 		}
 
+		abo = gem_to_amdgpu_bo(fb->obj[0]);
+
+		/* Wait for all fences on this FB */
+		r = reservation_object_wait_timeout_rcu(abo->tbo.resv, true,
+							false,
+							MAX_SCHEDULE_TIMEOUT);
+		WARN_ON(r < 0);
+
 		/*
 		 * TODO This might fail and hence better not used, wait
 		 * explicitly on fences instead
 		 * and in general should be called for
 		 * blocking commit to as per framework helpers
 		 */
-		abo = gem_to_amdgpu_bo(fb->obj[0]);
 		r = amdgpu_bo_reserve(abo, true);
 		if (unlikely(r != 0)) {
 			DRM_ERROR("failed to reserve buffer before flip\n");
 			WARN_ON(1);
 		}
 
-		/* Wait for all fences on this FB */
-		WARN_ON(reservation_object_wait_timeout_rcu(abo->tbo.resv, true, false,
-									    MAX_SCHEDULE_TIMEOUT) < 0);
-
 		amdgpu_bo_get_tiling_flags(abo, &tiling_flags);
 
 		amdgpu_bo_unreserve(abo);
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2019-04-17 19:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-16 18:23 [PATCH v4 1/5] drm/amd/display: wait for fence without holding reservation lock Andrey Grodzovsky
2019-04-16 18:23 ` [PATCH v4 2/5] drm/amd/display: Use a reasonable timeout for framebuffer fence waits Andrey Grodzovsky
     [not found] ` <1555438986-18303-1-git-send-email-andrey.grodzovsky-5C7GfCeVMHo@public.gmane.org>
2019-04-16 18:23   ` [PATCH v4 3/5] drm/scheduler: rework job destruction Andrey Grodzovsky
2019-04-17 14:36     ` Grodzovsky, Andrey
2019-04-17 17:17       ` Christian König
     [not found]         ` <a7766a6f-e22f-daf8-99f5-e46a7eb8e679-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2019-04-17 17:53           ` Grodzovsky, Andrey
     [not found]             ` <a883b69d-a84e-d498-658c-7bc1ad10bbef-5C7GfCeVMHo@public.gmane.org>
2019-04-17 17:59               ` Christian König
2019-04-17 18:01                 ` Koenig, Christian
2019-04-17 18:29                   ` Grodzovsky, Andrey
2019-04-17 19:08                     ` Koenig, Christian
2019-04-16 18:23   ` [PATCH v4 4/5] drm/sched: Keep s_fence->parent pointer Andrey Grodzovsky
2019-04-16 18:23   ` [PATCH v4 5/5] drm/amdgpu: Avoid HW reset if guilty job already signaled Andrey Grodzovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.