st/dri: fix deadlock when waiting on android fences
authorMarek Olšák <marek.olsak@amd.com>
Fri, 10 Nov 2017 18:08:50 +0000 (19:08 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Sat, 11 Nov 2017 03:12:53 +0000 (04:12 +0100)
Android fences can't be deferred, because st/dri calls fence_finish
with ctx = NULL, so the driver can't flush u_threaded_context.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/include/state_tracker/st_api.h
src/gallium/state_trackers/dri/dri_helpers.c
src/mesa/state_tracker/st_manager.c

index 6cdaefc902f72bc5bc4c727e35fd42eaf3525bc7..a407b980d94276b0b14720ec5cb0787d2925edb6 100644 (file)
@@ -147,8 +147,7 @@ enum st_attachment_type {
 #define ST_FLUSH_FRONT                    (1 << 0)
 #define ST_FLUSH_END_OF_FRAME             (1 << 1)
 #define ST_FLUSH_WAIT                     (1 << 2)
-#define ST_FLUSH_DEFERRED                 (1 << 3)
-#define ST_FLUSH_FENCE_FD                 (1 << 4)
+#define ST_FLUSH_FENCE_FD                 (1 << 3)
 
 /**
  * Value to st_manager->get_param function.
index 4a61455b1f9d4acc38d238de162a086f828ecbb3..37ab2c2f404e4725fe7c424f781cc56c3fae6709 100644 (file)
@@ -116,8 +116,7 @@ dri2_create_fence_fd(__DRIcontext *_ctx, int fd)
 
    if (fd == -1) {
       /* exporting driver created fence, flush: */
-      stapi->flush(stapi, ST_FLUSH_DEFERRED | ST_FLUSH_FENCE_FD,
-                   &fence->pipe_fence);
+      stapi->flush(stapi, ST_FLUSH_FENCE_FD, &fence->pipe_fence);
    } else {
       /* importing a foreign fence fd: */
       ctx->create_fence_fd(ctx, &fence->pipe_fence, fd);
index 43d5dfdced201986c7f04034a2ade8d3303209c9..4a1998cae632b34e3382670c909cb71bfa47b760 100644 (file)
@@ -634,8 +634,6 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags,
 
    if (flags & ST_FLUSH_END_OF_FRAME)
       pipe_flags |= PIPE_FLUSH_END_OF_FRAME;
-   if (flags & ST_FLUSH_DEFERRED)
-      pipe_flags |= PIPE_FLUSH_DEFERRED;
    if (flags & ST_FLUSH_FENCE_FD)
       pipe_flags |= PIPE_FLUSH_FENCE_FD;