From 122536ee0aeb1eef1a9d80d5e464dcb423dc2837 Mon Sep 17 00:00:00 2001 From: Mario Kleiner Date: Mon, 22 Nov 2010 04:11:07 +0100 Subject: ddx/ati: Add option "SwapbuffersWait" to control vsync of DRI2 swaps. A new optional kms driver option "SwapbuffersWait" is defined for xorg.conf, which defaults to "on". If "on", DRI2 bufferswaps will be synchronized to vsync, otherwise not. This currently only affects copy-swaps, not pageflipped swaps. It also requires a swap_interval setting of zero by the OpenGL client. Ideally, we'd provide a way for dri2 to pass the current swap interval to the ddx so we could change this dynamically. Signed-off-by: Mario Kleiner --- src/radeon_kms.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/radeon_kms.c') diff --git a/src/radeon_kms.c b/src/radeon_kms.c index 38467c07..59f82818 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -71,6 +71,7 @@ const OptionInfoRec RADEONOptions_KMS[] = { { OPTION_EXA_PIXMAPS, "EXAPixmaps", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_ZAPHOD_HEADS, "ZaphodHeads", OPTV_STRING, {0}, FALSE }, { OPTION_PAGE_FLIP, "EnablePageFlip", OPTV_BOOLEAN, {0}, FALSE }, + { OPTION_SWAPBUFFERS_WAIT,"SwapbuffersWait", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; @@ -628,6 +629,11 @@ Bool RADEONPreInit_KMS(ScrnInfoPtr pScrn, int flags) "KMS Pageflipping: %sabled\n", info->allowPageFlip ? "en" : "dis"); } + info->swapBuffersWait = xf86ReturnOptValBool(info->Options, + OPTION_SWAPBUFFERS_WAIT, TRUE); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "SwapBuffers wait for vsync: %sabled\n", info->swapBuffersWait ? "en" : "dis"); + if (drmmode_pre_init(pScrn, &info->drmmode, pScrn->bitsPerPixel / 8) == FALSE) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Kernel modesetting setup failed\n"); goto fail; -- cgit v1.2.3