From a7780eccbb9919df652e97960918a56f048ece1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 4 Sep 2018 12:18:19 +0200 Subject: [PATCH] loader/dri3: Only wait for fence when necessary in dri3_get_buffer MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We only need to wait for the fence before drawing to a buffer, not before reading from it. Also, we don't need to wait before drawing to the fake front buffer, as front buffer rendering by definition is allowed to produce artifacts. Fixes hangs in some cases with front buffer rendering. Bugzilla: https://bugs.freedesktop.org/106404 --- src/loader/loader_dri3_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/loader/loader_dri3_helper.c b/src/loader/loader_dri3_helper.c index 91bad86afd8..c173a61ba06 100644 --- a/src/loader/loader_dri3_helper.c +++ b/src/loader/loader_dri3_helper.c @@ -1778,7 +1778,6 @@ dri3_get_buffer(__DRIdrawable *driDrawable, && buffer) { /* Fill the new buffer with data from an old buffer */ - dri3_fence_await(draw->conn, draw, buffer); if (!loader_dri3_blit_image(draw, new_buffer->image, buffer->image, @@ -1819,7 +1818,9 @@ dri3_get_buffer(__DRIdrawable *driDrawable, buffer = new_buffer; draw->buffers[buf_id] = buffer; } - dri3_fence_await(draw->conn, draw, buffer); + + if (buffer_type == loader_dri3_buffer_back) + dri3_fence_await(draw->conn, draw, buffer); /* * Do we need to preserve the content of a previous buffer? -- 2.19.0.rc1