panfrost: Unset shared/scanout binding flags for staging resources
authorIcecream95 <ixn@disroot.org>
Thu, 15 Apr 2021 21:45:48 +0000 (09:45 +1200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 15 Apr 2021 23:12:30 +0000 (23:12 +0000)
Fixes Xwayland crashes when starting non-GL applications.

Fixes: e00d94f14f7 ("panfrost: Enable AFBC buffer sharing")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10266>

src/gallium/drivers/panfrost/pan_resource.c

index c4748b2..a7e030d 100644 (file)
@@ -732,6 +732,7 @@ pan_alloc_staging(struct panfrost_context *ctx, struct panfrost_resource *rsc,
         }
         tmpl.last_level = 0;
         tmpl.bind |= PIPE_BIND_LINEAR;
+        tmpl.bind &= ~(PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT | PIPE_BIND_SHARED);
 
         struct pipe_resource *pstaging =
                 pctx->screen->resource_create(pctx->screen, &tmpl);