loader_dri3: Increase the likelyhood of reusing the current swap buffer
authorThomas Hellstrom <thellstrom@vmware.com>
Thu, 10 Aug 2017 13:59:58 +0000 (15:59 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Thu, 17 Aug 2017 05:39:42 +0000 (07:39 +0200)
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/loader/loader_dri3_helper.c

index 131c9e9e87b256706533e4ebbb25c1b501622099..b3f0482848188aa38b1754eafb9bccf110a6a6aa 100644 (file)
@@ -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);