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@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7033>
(cherry picked from commit 16a7cc4d44)
This commit is contained in:
Michel Dänzer 2020-10-06 17:52:08 +02:00 committed by Dylan Baker
parent 86a542b0ab
commit fa73f34f79
2 changed files with 4 additions and 1 deletions

View file

@ -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
},

View file

@ -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