From 49b8f72e3d84891ebf09a09578c4623a42c9e56f Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 5 May 2022 13:19:51 -0400 Subject: [PATCH] kopper: pass the current context to dri_flush passing the drawable's context leads to desync and crashing if the app is using multiple threads and multiple contexts Reviewed-by: Adam Jackson Part-of: --- src/gallium/frontends/dri/kopper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/frontends/dri/kopper.c b/src/gallium/frontends/dri/kopper.c index b7e84ff3156..ef6e2585fa6 100644 --- a/src/gallium/frontends/dri/kopper.c +++ b/src/gallium/frontends/dri/kopper.c @@ -913,7 +913,7 @@ kopperSwapBuffers(__DRIdrawable *dPriv) return 0; drawable->texture_stamp = dPriv->lastStamp - 1; - dri_flush(dPriv->driContextPriv, dPriv, __DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_CONTEXT, __DRI2_THROTTLE_SWAPBUFFER); + dri_flush(ctx->cPriv, dPriv, __DRI2_FLUSH_DRAWABLE | __DRI2_FLUSH_CONTEXT, __DRI2_THROTTLE_SWAPBUFFER); kopper_copy_to_front(ctx->st->pipe, dPriv, ptex); if (kdraw->is_window && !zink_kopper_check(ptex)) return -1;