From 229084f5de848ea83c83b6d0743edfc90eddb428 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Fri, 29 May 2020 14:02:43 -0400 Subject: [PATCH] panfrost: Disable QUAD_STRIP/POLYGON on Bifrost Support was dropped and now raises a DATA_INVALID_FAULT on G31. Unknown if retained on other devices. GL_QUADS is still ok. Signed-off-by: Alyssa Rosenzweig Part-of: --- src/gallium/drivers/panfrost/pan_context.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c index af822877635..e0f5758d217 100644 --- a/src/gallium/drivers/panfrost/pan_context.c +++ b/src/gallium/drivers/panfrost/pan_context.c @@ -1401,6 +1401,7 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags) { struct panfrost_context *ctx = rzalloc(screen, struct panfrost_context); struct pipe_context *gallium = (struct pipe_context *) ctx; + struct panfrost_device *dev = pan_device(screen); gallium->screen = screen; @@ -1472,8 +1473,15 @@ panfrost_create_context(struct pipe_screen *screen, void *priv, unsigned flags) gallium->const_uploader = gallium->stream_uploader; assert(gallium->stream_uploader); - /* Midgard supports ES modes, plus QUADS/QUAD_STRIPS/POLYGON */ - ctx->draw_modes = (1 << (PIPE_PRIM_POLYGON + 1)) - 1; + /* All of our GPUs support ES mode. Midgard supports additionally + * QUADS/QUAD_STRIPS/POLYGON. Bifrost supports just QUADS. */ + + ctx->draw_modes = (1 << (PIPE_PRIM_QUADS + 1)) - 1; + + if (!(dev->quirks & IS_BIFROST)) { + ctx->draw_modes |= (1 << PIPE_PRIM_QUAD_STRIP); + ctx->draw_modes |= (1 << PIPE_PRIM_POLYGON); + } ctx->primconvert = util_primconvert_create(gallium, ctx->draw_modes); -- 2.30.2