Mesa (master): loader_dri3: Increase the likelyhood of reusing the current swap buffer

Thomas Hellstrom thomash at kemper.freedesktop.org
Thu Aug 17 05:48:00 UTC 2017


Module: Mesa
Branch: master
Commit: f71e174bb8d01855b56523348e5b8f50a6a5ce78
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f71e174bb8d01855b56523348e5b8f50a6a5ce78

Author: Thomas Hellstrom <thellstrom at vmware.com>
Date:   Thu Aug 10 15:59:58 2017 +0200

loader_dri3: Increase the likelyhood of reusing the current swap buffer

Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>

---

 src/loader/loader_dri3_helper.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
index 131c9e9e87..b3f0482848 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);




More information about the mesa-commit mailing list