From 211862b777d0be251a4662f5dd24f2d400544c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 1 May 2015 18:20:01 +0900 Subject: present: Look at all CRTCs to determine if we can flip Inspired by modesetting driver change by Kenneth Graunke. Reviewed-by: Alex Deucher --- src/radeon_present.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/radeon_present.c b/src/radeon_present.c index bc1053ef..49acb233 100644 --- a/src/radeon_present.c +++ b/src/radeon_present.c @@ -229,6 +229,9 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, ScrnInfoPtr scrn = xf86ScreenToScrn(screen); RADEONInfoPtr info = RADEONPTR(scrn); PixmapPtr screen_pixmap; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); + int num_crtcs_on; + int i; if (!scrn->vtSema) return FALSE; @@ -250,17 +253,20 @@ radeon_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, radeon_present_get_pixmap_tiling_flags(info, screen_pixmap)) return FALSE; - if (crtc) { - xf86CrtcPtr xf86_crtc = crtc->devPrivate; - drmmode_crtc_private_ptr drmmode_crtc = xf86_crtc->driver_private; + for (i = 0, num_crtcs_on = 0; i < config->num_crtc; i++) { + drmmode_crtc_private_ptr drmmode_crtc = config->crtc[i]->driver_private; + + if (!config->crtc[i]->enabled) + continue; - if (!drmmode_crtc || - drmmode_crtc->rotate.bo != NULL || - drmmode_crtc->dpms_mode != DPMSModeOn) + if (!drmmode_crtc || drmmode_crtc->rotate.bo != NULL) return FALSE; + + if (drmmode_crtc->dpms_mode == DPMSModeOn) + num_crtcs_on++; } - return TRUE; + return num_crtcs_on > 0; } /* -- cgit v1.2.3