diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-07 09:07:16 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-07 09:12:52 +0100 |
commit | 717e00facd27696c6b8a1a6c343b2f94bfa2b59b (patch) | |
tree | 796042dc2584a2114ecc3a1d1bb48ca28778196c | |
parent | dcb64b55092ea3da6adf357305d65b58d848db7b (diff) |
sna: Allow TearFree to be enabled by default via configure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | configure.ac | 10 | ||||
-rw-r--r-- | src/sna/sna_driver.c | 14 |
2 files changed, 20 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 9aeeb813..8e3dbf79 100644 --- a/configure.ac +++ b/configure.ac @@ -668,6 +668,16 @@ AC_MSG_RESULT($accel) xp_msg="" +AC_ARG_ENABLE(tear-free, + AS_HELP_STRING([--enable-tear-free], + [Enable use of TearFree by default [default=no]]), + [TEARFREE="$enableval"], + [TEARFREE="no"]) +if test "x$TEARFREE" = "xyes"; then + AC_DEFINE(TEARFREE,1,[Enable "TearFree" by default]) + xp_msg="$xp_msg TearFree" +fi + AC_ARG_ENABLE(rendernode, AS_HELP_STRING([--enable-rendernode], [Enable use of render nodes (experimental) [default=no]]), diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index 3810090e..97872a74 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -71,6 +71,12 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "git_version.h" #endif +#ifdef TEARFREE +#define ENABLE_TEAR_FREE TRUE +#else +#define ENABLE_TEAR_FREE FALSE +#endif + DevPrivateKeyRec sna_pixmap_key; DevPrivateKeyRec sna_gc_key; DevPrivateKeyRec sna_window_key; @@ -627,10 +633,6 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags) sna->flags |= SNA_TRIPLE_BUFFER; DBG(("%s: triple buffer? %s\n", __FUNCTION__, sna->flags & SNA_TRIPLE_BUFFER ? "enabled" : "disabled")); - if ((sna->flags & (SNA_NO_VSYNC | SNA_NO_FLIP)) == 0 && - xf86ReturnOptValBool(sna->Options, OPTION_TEAR_FREE, FALSE)) - sna->flags |= SNA_TEAR_FREE; - if (xf86ReturnOptValBool(sna->Options, OPTION_CRTC_PIXMAPS, FALSE)) sna->flags |= SNA_FORCE_SHADOW; @@ -654,6 +656,10 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags) } scrn->currentMode = scrn->modes; + if (sna->flags & SNA_HAS_FLIP && + xf86ReturnOptValBool(sna->Options, OPTION_TEAR_FREE, ENABLE_TEAR_FREE)) + sna->flags |= SNA_TEAR_FREE; + xf86SetGamma(scrn, zeros); xf86SetDpi(scrn, 0, 0); |