[Mesa-dev] [PATCH 05/11] loader_dri3: Increase the likelyhood of reusing the current swap buffer

Thomas Hellstrom thellstrom at vmware.com
Fri Aug 11 14:14:14 UTC 2017


Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
---
 src/loader/loader_dri3_helper.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
index 4959e95..6f84a43 100644
--- a/src/loader/loader_dri3_helper.c
+++ b/src/loader/loader_dri3_helper.c
@@ -56,6 +56,8 @@ static struct loader_dri3_blit_context blit_context = {
    _MTX_INITIALIZER_NP, NULL
 };
 
+static void
+dri3_flush_present_events(struct loader_dri3_drawable *draw);
 
 /**
  * Get and lock (for use with the current thread) a dri context associated
@@ -474,6 +476,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);
-- 
2.7.4



More information about the mesa-dev mailing list