mirror of
https://github.com/X11Libre/xf86-video-amdgpu.git
synced 2026-04-14 11:04:42 +00:00
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 St Denis <tom.stdenis@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
This commit is contained in:
committed by
Michel Dänzer
parent
a1e47e7632
commit
bfa925a048
@@ -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 (!drmmode_crtc ||
|
||||
drmmode_crtc->rotate.bo != NULL ||
|
||||
drmmode_crtc->dpms_mode != DPMSModeOn)
|
||||
if (!config->crtc[i]->enabled)
|
||||
continue;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user