diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-02-09 13:46:32 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-02-09 13:46:32 +1000 |
commit | e4fb9fd2f790ed66e4be61ca00d55522525619f4 (patch) | |
tree | 18f2bdcc7a540a1f96a5d45b90a9d5b7e9c61b52 | |
parent | 38e8809bb415bae5c182fc79c8fc62992c5e4ed0 (diff) | |
download | xorg-driver-xf86-video-nouveau-e4fb9fd2f790ed66e4be61ca00d55522525619f4.tar.gz |
dri2: allow page flipping to be disabled in xorg.conf
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r-- | src/nv_const.h | 2 | ||||
-rw-r--r-- | src/nv_driver.c | 17 |
2 files changed, 16 insertions, 3 deletions
diff --git a/src/nv_const.h b/src/nv_const.h index 01ffc2c..a27a951 100644 --- a/src/nv_const.h +++ b/src/nv_const.h @@ -14,6 +14,7 @@ typedef enum { OPTION_WFB, OPTION_GLX_VBLANK, OPTION_ZAPHOD_HEADS, + OPTION_PAGE_FLIP, } NVOpts; @@ -26,6 +27,7 @@ static const OptionInfoRec NVOptions[] = { { OPTION_WFB, "WrappedFB", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_GLX_VBLANK, "GLXVBlank", OPTV_BOOLEAN, {0}, FALSE }, { OPTION_ZAPHOD_HEADS, "ZaphodHeads", OPTV_STRING, {0}, FALSE }, + { OPTION_PAGE_FLIP, "PageFlip", OPTV_BOOLEAN, {0}, FALSE }, { -1, NULL, OPTV_NONE, {0}, FALSE } }; diff --git a/src/nv_driver.c b/src/nv_driver.c index 5286ff4..3e009fc 100644 --- a/src/nv_driver.c +++ b/src/nv_driver.c @@ -596,6 +596,7 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) struct nouveau_device *dev; NVPtr pNv; MessageType from; + const char *reason; uint64_t v; int ret, i; @@ -812,14 +813,24 @@ NVPreInit(ScrnInfoPtr pScrn, int flags) } #ifdef NOUVEAU_GETPARAM_HAS_PAGEFLIP + reason = ": no kernel support"; + from = X_DEFAULT; + ret = nouveau_device_get_param(pNv->dev, NOUVEAU_GETPARAM_HAS_PAGEFLIP, &v); - if (!ret) - pNv->has_pageflip = v; + if (ret == 0 && v == 1) { + pNv->has_pageflip = TRUE; + if (xf86GetOptValBool(pNv->Options, OPTION_PAGE_FLIP, &pNv->has_pageflip)) + from = X_CONFIG; + reason = ""; + } #else - (void)v; + reason = ": not available at build time"; #endif + xf86DrvMsg(pScrn->scrnIndex, from, "Page flipping %sabled%s\n", + pNv->has_pageflip ? "en" : "dis", reason); + if(xf86GetOptValInteger(pNv->Options, OPTION_VIDEO_KEY, &(pNv->videoKey))) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "video key set to 0x%x\n", pNv->videoKey); |