summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/amdgpu_present.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
index c0b2f17..edfccb1 100644
--- a/src/amdgpu_present.c
+++ b/src/amdgpu_present.c
@@ -211,15 +211,13 @@ amdgpu_present_flush(WindowPtr window)
}
/*
- * Test to see if page flipping is possible on the target crtc
+ * Test to see if unflipping is possible
+ *
+ * These tests have to pass for flips as well
*/
static Bool
-amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
- Bool sync_flip)
+amdgpu_present_check_unflip(ScrnInfoPtr scrn)
{
- 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;
@@ -227,15 +225,6 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
if (!scrn->vtSema)
return FALSE;
- if (!info->allowPageFlip)
- return FALSE;
-
- if (info->hwcursor_disabled)
- return FALSE;
-
- if (info->drmmode.dri2_flipping)
- return FALSE;
-
for (i = 0, num_crtcs_on = 0; i < config->num_crtc; i++) {
drmmode_crtc_private_ptr drmmode_crtc = config->crtc[i]->driver_private;
@@ -254,6 +243,29 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
}
/*
+ * Test to see if page flipping is possible on the target crtc
+ */
+static Bool
+amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
+ Bool sync_flip)
+{
+ ScreenPtr screen = window->drawable.pScreen;
+ ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
+ AMDGPUInfoPtr info = AMDGPUPTR(scrn);
+
+ if (!info->allowPageFlip)
+ return FALSE;
+
+ if (info->hwcursor_disabled)
+ return FALSE;
+
+ if (info->drmmode.dri2_flipping)
+ return FALSE;
+
+ return amdgpu_present_check_unflip(scrn);
+}
+
+/*
* Once the flip has been completed on all CRTCs, notify the
* extension code telling it when that happened
*/
@@ -333,7 +345,7 @@ amdgpu_present_unflip(ScreenPtr screen, uint64_t event_id)
PixmapPtr pixmap = screen->GetScreenPixmap(screen);
int i;
- if (!amdgpu_present_check_flip(NULL, screen->root, pixmap, TRUE))
+ if (!amdgpu_present_check_unflip(scrn))
goto modeset;
event = calloc(1, sizeof(struct amdgpu_present_vblank_event));