diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2015-05-01 18:20:01 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2015-07-09 10:24:22 +0900 |
commit | 211862b777d0be251a4662f5dd24f2d400544c09 (patch) | |
tree | 16201c6c829e39782942b9c4ca0e37f5adbbbb8b | |
parent | 802d33e474a82262d9cdf11b03568b0c4929cd0d (diff) |
present: Look at all CRTCs to determine if we can flip
Inspired by modesetting driver change by Kenneth Graunke.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | src/radeon_present.c | 20 |
1 files 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; } /* |