[PATCH v2 xf86-video-amdgpu] Bail early from drm_wait_pending_flip if there's no pending flip

Michel Dänzer michel at daenzer.net
Wed Sep 5 09:20:55 UTC 2018


From: Michel Dänzer <michel.daenzer at amd.com>

No need to process any events in that case.

v2:
* Re-check drmmode_crtc->flip_pending after processing each event

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/amdgpu_drm_queue.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/amdgpu_drm_queue.c b/src/amdgpu_drm_queue.c
index ba841d1ef..035356234 100644
--- a/src/amdgpu_drm_queue.c
+++ b/src/amdgpu_drm_queue.c
@@ -284,7 +284,8 @@ void amdgpu_drm_wait_pending_flip(xf86CrtcPtr crtc)
 
 	drmmode_crtc->wait_flip_nesting_level++;
 
-	while (!xorg_list_is_empty(&amdgpu_drm_flip_signalled)) {
+	while (drmmode_crtc->flip_pending &&
+	       !xorg_list_is_empty(&amdgpu_drm_flip_signalled)) {
 		e = xorg_list_first_entry(&amdgpu_drm_flip_signalled,
 					  struct amdgpu_drm_queue_entry, list);
 		amdgpu_drm_queue_handle_one(e);
-- 
2.19.0.rc1



More information about the amd-gfx mailing list