summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2015-12-24 15:42:37 +0000
committerSean V Kelley <seanvk@posteo.de>2016-11-16 10:06:52 -0800
commit6b8fbf6ea348bb2970af2df9b8e0b3493e3e86f5 (patch)
tree82c96262ba2677038b7e8fbaa0213a6325af5616
parent3a7547be5a49106dabfeb594869a85fa03a6b9b8 (diff)
va/x11: Require synchronisation to vblank with DRI2SwapBuffers
By passing divisor=0, we imply we do not care about synchronisation of this request to the vertical refresh - the spec says that if we miss the target frame, the swap will be presented as quickly as possible and may forgo waiting until the next vblank. By using divisor=1, we request that the swap be presented upon the vertical refresh immediately following recipe, enforcing the synchronisation to vblank and avoiding tearing. Reported-and-tested-by: Lukas Hejtmanek <xhejtman@ics.muni.cz> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Sean V Kelley <seanvk@posteo.de>
-rw-r--r--va/x11/dri2_util.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/va/x11/dri2_util.c b/va/x11/dri2_util.c
index 1245432..4fddf37 100644
--- a/va/x11/dri2_util.c
+++ b/va/x11/dri2_util.c
@@ -95,8 +95,9 @@ dri2SwapBuffer(VADriverContextP ctx, struct dri_drawable *dri_drawable)
if (dri2_drawable->has_backbuffer) {
if (gsDRI2SwapAvailable) {
CARD64 ret;
- VA_DRI2SwapBuffers(ctx->native_dpy, dri_drawable->x_drawable, 0, 0,
- 0, &ret);
+ VA_DRI2SwapBuffers(ctx->native_dpy, dri_drawable->x_drawable,
+ 0, 1, 0,
+ &ret);
} else {
xrect.x = 0;
xrect.y = 0;