summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac10
-rw-r--r--src/sna/sna_driver.c14
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);