Mesa (staging/20.2): loader/dri3: Keep current number of back buffers if frame was skipped

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Nov 2 16:09:38 UTC 2020


Module: Mesa
Branch: staging/20.2
Commit: fa73f34f79cc1a8b6deca0d7760b0a615eb97713
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fa73f34f79cc1a8b6deca0d7760b0a615eb97713

Author: Michel Dänzer <mdaenzer at redhat.com>
Date:   Tue Oct  6 17:52:08 2020 +0200

loader/dri3: Keep current number of back buffers if frame was skipped

We'd previously take the copy path. If we were actually flipping (in
which case skipped frames are more likely to occur), we'd ping-pong
between a smaller and larger number of back buffers, and frame-rate
could vary / take a dip due to the buffer management overhead.

While I'm not sure this is actually possible to hit at this point, it
definitely will be with the next change.

Cc: mesa-stable
Reviewed-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Adam Jackson <ajax at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7033>
(cherry picked from commit 16a7cc4d449efa51f9ec2fd47df38a76c12e8e52)

---

 .pick_status.json               | 2 +-
 src/loader/loader_dri3_helper.c | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 9d78ef42d11..10de6697160 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1210,7 +1210,7 @@
         "description": "loader/dri3: Keep current number of back buffers if frame was skipped",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c
index 488c038ae5d..14af1eb0661 100644
--- a/src/loader/loader_dri3_helper.c
+++ b/src/loader/loader_dri3_helper.c
@@ -280,6 +280,9 @@ dri3_update_max_num_back(struct loader_dri3_drawable *draw)
       draw->max_num_back = 3;
       break;
 
+   case XCB_PRESENT_COMPLETE_MODE_SKIP:
+      break;
+
    default:
       /* On transition from flips to copies, start with a single buffer again,
        * a second one will be allocated if needed



More information about the mesa-commit mailing list