Revert "st/mesa: execute glFlush asynchronously if no image has been imported/exported"
authorRob Clark <robdclark@chromium.org>
Wed, 9 Jun 2021 20:29:50 +0000 (13:29 -0700)
committerMarge Bot <eric+marge@anholt.net>
Wed, 9 Jun 2021 22:18:35 +0000 (22:18 +0000)
A number of the piglit glx tests use multiple contexts on a single
thread, and previously the flush in MakeCurrent() was enforcing the
ordering between draws on those different contexts.  When that flush
made ASYNC, now there is nothing ordering the draws because we have
two (or more) driver threads for a single frontend thread which is
using nothing more than glxMakeCurrent() to enforce the ordering.

This reverts commit 057a702a3f6a78a8bcd347a74e5a79d70dfc4153.

Fixes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4903
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11278>

src/gallium/frontends/dri/dri_helpers.c
src/mesa/main/mtypes.h
src/mesa/state_tracker/st_cb_eglimage.c
src/mesa/state_tracker/st_cb_flush.c

index 583ce67..4170a4c 100644 (file)
@@ -309,7 +309,6 @@ dri2_create_image_from_renderbuffer2(__DRIcontext *context,
    if (dri2_get_mapping_by_format(img->dri_format))
       p_ctx->flush_resource(p_ctx, tex);
 
-   ctx->Shared->HasExternallySharedImages = true;
    *error = __DRI_IMAGE_ERROR_SUCCESS;
    return img;
 }
@@ -408,7 +407,6 @@ dri2_create_from_texture(__DRIcontext *context, int target, unsigned texture,
    if (dri2_get_mapping_by_format(img->dri_format))
       p_ctx->flush_resource(p_ctx, tex);
 
-   ctx->Shared->HasExternallySharedImages = true;
    *error = __DRI_IMAGE_ERROR_SUCCESS;
    return img;
 }
index e7474ad..ee1c19d 100644 (file)
@@ -3474,14 +3474,6 @@ struct gl_shared_state
     * frequency changes.
     */
    bool DisjointOperation;
-
-   /**
-    * Whether at least one image has been imported or exported, excluding
-    * the default framebuffer. If this is false, glFlush can be executed
-    * asynchronously because there is no invisible dependency on external
-    * users.
-    */
-   bool HasExternallySharedImages;
 };
 
 
index 9bd5314..0c487d0 100644 (file)
@@ -192,7 +192,6 @@ st_get_egl_image(struct gl_context *ctx, GLeglImageOES image_handle,
       return false;
    }
 
-   ctx->Shared->HasExternallySharedImages = true;
    return true;
 }
 
index ee72c33..bec1c2f 100644 (file)
@@ -98,7 +98,7 @@ st_glFlush(struct gl_context *ctx)
     * synchronization issues.  Calling finish() here will just hide
     * problems that need to be fixed elsewhere.
     */
-   st_flush(st, NULL, ctx->Shared->HasExternallySharedImages ? 0 : PIPE_FLUSH_ASYNC);
+   st_flush(st, NULL, 0);
 
    st_manager_flush_frontbuffer(st);
 }