summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-07 09:07:16 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-07 09:12:52 +0100
commit717e00facd27696c6b8a1a6c343b2f94bfa2b59b (patch)
tree796042dc2584a2114ecc3a1d1bb48ca28778196c /src/sna
parentdcb64b55092ea3da6adf357305d65b58d848db7b (diff)
sna: Allow TearFree to be enabled by default via configure
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna_driver.c14
1 files changed, 10 insertions, 4 deletions
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);