aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hellstrom <[email protected]>2017-08-10 15:59:58 +0200
committerThomas Hellstrom <[email protected]>2017-08-17 07:39:42 +0200
commitf71e174bb8d01855b56523348e5b8f50a6a5ce78 (patch)
tree468f9e4a00e15eec736b93124cfa2aaddd8156f1
parent2db95482964caf872f8f4b0ad6e0c34b3402c774 (diff)
loader_dri3: Increase the likelyhood of reusing the current swap buffer
Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Michel Dänzer <[email protected]>
-rw-r--r--src/loader/loader_dri3_helper.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
index 131c9e9e87b..b3f04828481 100644
--- a/src/loader/loader_dri3_helper.c
+++ b/src/loader/loader_dri3_helper.c
@@ -56,6 +56,9 @@ static struct loader_dri3_blit_context blit_context = {
_MTX_INITIALIZER_NP, NULL
};
+static void
+dri3_flush_present_events(struct loader_dri3_drawable *draw);
+
/**
* Do we have blit functionality in the image blit extension?
*
@@ -482,6 +485,9 @@ dri3_find_back(struct loader_dri3_drawable *draw)
xcb_generic_event_t *ev;
xcb_present_generic_event_t *ge;
+ /* Increase the likelyhood of reusing current buffer */
+ dri3_flush_present_events(draw);
+
for (;;) {
for (b = 0; b < draw->num_back; b++) {
int id = LOADER_DRI3_BACK_ID((b + draw->cur_back) % draw->num_back);