diff options
author | Brian Paul <[email protected]> | 2017-05-23 13:16:56 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2017-05-24 11:33:47 -0600 |
commit | 4a6fdeab05227457282fcef28c041fe0eb9369be (patch) | |
tree | 5f22ea94593494b96f1cc35a0f23a9e9c6c3152c /src/gallium/drivers/svga/svga_resource_buffer.c | |
parent | 0c84c395f8db8749a181141219fd4eb5aa9305c8 (diff) |
svga: init svga_screen::swc_mutex with mtx_recursive
If the SVGA3D_BindGBSurface() call in svga_buffer_hw_storage_unmap()
fails, we'll flush and that might involve unmapping other buffers.
That leads to a recursive lock on svga_screen::swc_mutex and causes
a deadlock. Fix this by initializing the mutex with mtx_recursive.
Note that this only happened on Linux, not Windows. On Windows, the
mutex functions are implemented with Win32 critical sections which
support recursive locking.
Also add a comment about this.
Fixes VMware bug 1831549 (Unigine Tropics demo freeze on Linux).
Reviewed-by: Thomas Hellstrom <[email protected]>
Reviewed-by: Neha Bhende<[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_resource_buffer.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_resource_buffer.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_buffer.c b/src/gallium/drivers/svga/svga_resource_buffer.c index 7808903083b..271d0787abb 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer.c +++ b/src/gallium/drivers/svga/svga_resource_buffer.c @@ -320,6 +320,9 @@ svga_buffer_transfer_unmap( struct pipe_context *pipe, } if (svga_buffer_has_hw_storage(sbuf)) { + /* Note: we may wind up flushing here and unmapping other buffers + * which leads to recursively locking ss->swc_mutex. + */ svga_buffer_hw_storage_unmap(svga, sbuf); } |