summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMario Kleiner <mario.kleiner.de@gmail.com>2014-03-14 18:27:53 +0100
committerBen Skeggs <bskeggs@redhat.com>2014-06-21 17:12:26 +1000
commit4d92001ebe6bec8c5eaab8156421e62a7e4dedc8 (patch)
treebde67a05e9ce5485281b003ed5425b8f48fa18c0
parent54dfbb2fed393b65d846e6ed9672acb47e0f19de (diff)
Add kernel async_flip cap detection. Part II of double-sync fix.
Query if kernel supports the async_flip cap, thereby needs the new sync behavior. Linux 3.13+ nouveau-kms have this cap and need this fix. Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--src/nv_driver.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nv_driver.c b/src/nv_driver.c
index db66de6..3ca65c5 100644
--- a/src/nv_driver.c
+++ b/src/nv_driver.c
@@ -1134,6 +1134,17 @@ NVPreInit(ScrnInfoPtr pScrn, int flags)
xf86DrvMsg(pScrn->scrnIndex, from, "Swap limit set to %d [Max allowed %d]%s\n",
pNv->swap_limit, pNv->max_swap_limit, reason);
+ /* Does kernel do the sync of pageflips to vblank? */
+ pNv->has_async_pageflip = FALSE;
+#ifdef DRM_CAP_ASYNC_PAGE_FLIP
+ ret = drmGetCap(pNv->dev->fd, DRM_CAP_ASYNC_PAGE_FLIP, &v);
+ if (ret == 0 && v == 1) {
+ pNv->has_async_pageflip = TRUE;
+ }
+ xf86DrvMsg(pScrn->scrnIndex, X_DEFAULT, "Page flipping synced to vblank by %s.\n",
+ pNv->has_async_pageflip ? "kernel" : "ddx");
+#endif
+
ret = drmmode_pre_init(pScrn, pNv->dev->fd, pScrn->bitsPerPixel >> 3);
if (ret == FALSE)
NVPreInitFail("Kernel modesetting failed to initialize\n");