summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-12-15 09:27:07 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-12-15 09:27:07 +0000
commit2c71a8e08abce74b269687d3a6c1edd7f9d643d3 (patch)
tree318c231530b295712f8b00ffff8d763009c59cec
parent6593ad3fecb3d044ee5ca161176d8ecaa0b4126a (diff)
downloadxf86-video-intel-2c71a8e08abce74b269687d3a6c1edd7f9d643d3.tar.gz
xf86-video-intel-2c71a8e08abce74b269687d3a6c1edd7f9d643d3.tar.bz2
xf86-video-intel-2c71a8e08abce74b269687d3a6c1edd7f9d643d3.zip
sna/dri: Honour TripleBuffer Option
In case anyone ever wants to disable the default. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/intel_options.c2
-rw-r--r--src/intel_options.h2
-rw-r--r--src/sna/sna.h1
-rw-r--r--src/sna/sna_dri.c2
-rw-r--r--src/sna/sna_driver.c2
5 files changed, 6 insertions, 3 deletions
diff --git a/src/intel_options.c b/src/intel_options.c
index 443e84d79..f7ff5958b 100644
--- a/src/intel_options.c
+++ b/src/intel_options.c
@@ -14,6 +14,7 @@ const OptionInfoRec intel_options[] = {
{OPTION_TILING_2D, "Tiling", OPTV_BOOLEAN, {0}, 1},
{OPTION_TILING_FB, "LinearFramebuffer", OPTV_BOOLEAN, {0}, 0},
{OPTION_SWAPBUFFERS_WAIT, "SwapbuffersWait", OPTV_BOOLEAN, {0}, 1},
+ {OPTION_TRIPLE_BUFFER, "TripleBuffer", OPTV_BOOLEAN, {0}, 1},
{OPTION_PREFER_OVERLAY, "XvPreferOverlay", OPTV_BOOLEAN, {0}, 0},
{OPTION_HOTPLUG, "HotPlug", OPTV_BOOLEAN, {0}, 1},
{OPTION_RELAXED_FENCING,"RelaxedFencing", OPTV_BOOLEAN, {0}, 1},
@@ -33,7 +34,6 @@ const OptionInfoRec intel_options[] = {
{OPTION_DEBUG_FLUSH_CACHES, "DebugFlushCaches", OPTV_BOOLEAN, {0}, 0},
{OPTION_DEBUG_WAIT, "DebugWait", OPTV_BOOLEAN, {0}, 0},
{OPTION_BUFFER_CACHE, "BufferCache", OPTV_BOOLEAN, {0}, 1},
- {OPTION_TRIPLE_BUFFER, "TripleBuffer", OPTV_BOOLEAN, {0}, 1},
#endif
{-1, NULL, OPTV_NONE, {0}, 0}
};
diff --git a/src/intel_options.h b/src/intel_options.h
index 3b5262a55..953fc9c8c 100644
--- a/src/intel_options.h
+++ b/src/intel_options.h
@@ -20,6 +20,7 @@ enum intel_options {
OPTION_TILING_2D,
OPTION_TILING_FB,
OPTION_SWAPBUFFERS_WAIT,
+ OPTION_TRIPLE_BUFFER,
OPTION_PREFER_OVERLAY,
OPTION_HOTPLUG,
OPTION_RELAXED_FENCING,
@@ -40,7 +41,6 @@ enum intel_options {
OPTION_DEBUG_FLUSH_CACHES,
OPTION_DEBUG_WAIT,
OPTION_BUFFER_CACHE,
- OPTION_TRIPLE_BUFFER,
#endif
NUM_OPTIONS,
};
diff --git a/src/sna/sna.h b/src/sna/sna.h
index 9b93ed91c..8861fd9a5 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -200,6 +200,7 @@ struct sna {
#define SNA_NO_FLIP 0x8
#define SNA_TEAR_FREE 0x10
#define SNA_FORCE_SHADOW 0x20
+#define SNA_TRIPLE_BUFFER 0x40
unsigned watch_flush;
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index c05e8b413..522549ac1 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -1769,7 +1769,7 @@ sna_dri_schedule_flip(ClientPtr client, DrawablePtr draw, DRI2BufferPtr front,
if (info == NULL)
return false;
- info->type = DRI2_FLIP_THROTTLE;
+ info->type = sna->flags & SNA_TRIPLE_BUFFER ? DRI2_FLIP_THROTTLE: DRI2_FLIP;
info->draw = draw;
info->client = client;
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index fc80cf34f..22770c797 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -504,6 +504,8 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
sna->flags |= SNA_NO_DELAYED_FLUSH;
if (!xf86ReturnOptValBool(sna->Options, OPTION_SWAPBUFFERS_WAIT, TRUE))
sna->flags |= SNA_NO_WAIT;
+ if (xf86ReturnOptValBool(sna->Options, OPTION_TRIPLE_BUFFER, TRUE))
+ sna->flags |= SNA_TRIPLE_BUFFER;
if (has_pageflipping(sna)) {
if (xf86ReturnOptValBool(sna->Options, OPTION_TEAR_FREE, FALSE))
sna->flags |= SNA_TEAR_FREE;