OSDN Git Service

gallium/swr: Fix multi-context sync fence deadlock.
authorBruce Cherniak <bruce.cherniak@intel.com>
Fri, 4 Jan 2019 20:53:59 +0000 (14:53 -0600)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 29 Jan 2019 15:19:40 +0000 (15:19 +0000)
commite38d275a862c6e8d4940c063e87f355b3be2d6fd
treeb79faf9da76706aeb631824a5ef246b2dec1ea65
parentf0eee7df432d75e671f16021afaf1eb8ac6b9ff7
gallium/swr: Fix multi-context sync fence deadlock.

Various recreation scenarios lead to API thread getting stuck in
swr_fence_finish().  This is a multi-context issue, whereby one context
overwrites the fence read-value with a previous sync's lesser value.
The fence sync value is supposed to be always increasing.

In swr_fence_cb(), only update the "read" value if the new value is
greater.

(This may seem like we're not waiting on the other context to finish, but
had we needed for it to finish there would have been a wait prior to
submitting a new sync.)

cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit ed7673afd2d1a31bfcec0520743acd2681b462e6)
src/gallium/drivers/swr/swr_fence.cpp