radeonsi: try flushing unflushed fences in si_fence_finish even when timeout == 0

Under certain conditions, waiting on a GL sync objects should act like
a flush, regardless of the timeout.

Portal 2, CS:GO, and presumably other Source engine games rely on this
behavior and hang during loading without this fix.

Fixes: bc65dcab3b ("radeonsi: avoid syncing the driver thread in si_fence_finish")

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103902
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103904
This commit is contained in:
Nicolai Hähnle 2017-11-22 17:52:43 +01:00 committed by Marek Olšák
parent 0bd83d0461
commit 0fed7f83ba
1 changed files with 3 additions and 3 deletions

View File

@ -191,9 +191,6 @@ static boolean si_fence_finish(struct pipe_screen *screen,
int64_t abs_timeout = os_time_get_absolute_timeout(timeout);
if (!util_queue_fence_is_signalled(&rfence->ready)) {
if (!timeout)
return false;
if (rfence->tc_token) {
/* Ensure that si_flush_from_st will be called for
* this fence, but only if we're in the API thread
@ -207,6 +204,9 @@ static boolean si_fence_finish(struct pipe_screen *screen,
timeout == 0);
}
if (!timeout)
return false;
if (timeout == PIPE_TIMEOUT_INFINITE) {
util_queue_fence_wait(&rfence->ready);
} else {