[PATCH xf86-video-ati 2/3] Make wait_pending_flip / handle_deferred symmetric in set_mode_major

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Michel Dänzer <michel.daenzer@xxxxxxx>

We were always calling the latter, but not always the former, which
could result in handling deferred DRM events prematurely.

(Ported from amdgpu commit 955373a3e69baa241a1f267e96d04ddb902f689f)

Signed-off-by: Michel Dänzer <michel.daenzer@xxxxxxx>
---
 src/drmmode_display.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 7493d636e..32ffe84ed 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -857,6 +857,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 	RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn);
 	xf86CrtcConfigPtr   xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
 	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
+	Bool handle_deferred = FALSE;
 	unsigned scanout_id = 0;
 	drmmode_ptr drmmode = drmmode_crtc->drmmode;
 	int saved_x, saved_y;
@@ -924,6 +925,7 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		}
 
 		radeon_drm_wait_pending_flip(crtc);
+		handle_deferred = TRUE;
 
 		if (!drmmode_set_mode(crtc, fb, mode, x, y))
 			goto done;
@@ -983,7 +985,9 @@ done:
 		}
 	}
 
-	radeon_drm_queue_handle_deferred(crtc);
+	if (handle_deferred)
+		radeon_drm_queue_handle_deferred(crtc);
+
 	return ret;
 }
 
-- 
2.19.1

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




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux