Commit bfa925a0 authored by Tom Denis's avatar Tom Denis Committed by Michel Dänzer

present: Look at all CRTCs to determine if we can flip

Based on radeon commit 211862b777d0be251a4662f5dd24f2d400544c09

Inspired by modesetting driver change by Kenneth Graunke.
Signed-off-by: Tom Denis's avatarTom St Denis <tom.stdenis@amd.com>
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
parent a1e47e76
......@@ -213,6 +213,9 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
ScreenPtr screen = window->drawable.pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
AMDGPUInfoPtr info = AMDGPUPTR(scrn);
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
int num_crtcs_on;
int i;
if (!scrn->vtSema)
return FALSE;
......@@ -226,17 +229,20 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
if (info->drmmode.dri2_flipping)
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;
}
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment