Skip to content
Commit 9be5e0cf authored by Thomas Hellstrom's avatar Thomas Hellstrom Committed by Juan A. Suarez Romero
Browse files

loader/dri3: Avoid freeing renderbuffers in use

Upon reception of an event that lowered the number of active back buffers,
the code would immediately try to free all back buffers with an id equal to or
higher than the new number of active back buffers.

However, that could lead to an active or to-be-active back buffer being freed,
since the old number of back buffers was used when obtaining an idle back
buffer for use.

This lead to crashes when lowering the number of active back buffers by
transitioning from page-flipping to non-page-flipping presents.

Fix this by computing the number of active back buffers only when trying to
obtain a new back buffer.

Fixes: 15e208c4 ("loader/dri3: Don't accidently free buffer holding new back content")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104214


Cc: "17.3" <mesa-stable@lists.freedesktop.org>
Tested-by: default avatarAndriy.Khulap <andriy.khulap@globallogic.com>
Tested-by: default avatarVadym Shovkoplias <vadym.shovkoplias@globallogic.com>
Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarThomas Hellstrom <thellstrom@vmware.com>
(cherry picked from commit 897c54d5)
parent d774fe8e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment