From b5aba6110e4ffaf2c2032852b414d820b7178c0d Mon Sep 17 00:00:00 2001 From: Rudi Heitbaum Date: Tue, 29 Mar 2022 23:01:05 +0000 Subject: [PATCH 1/2] mesa: update to 22.0.1 announce: https://lists.freedesktop.org/archives/mesa-announce/2022-March/000667.html --- packages/graphics/mesa/package.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/graphics/mesa/package.mk b/packages/graphics/mesa/package.mk index 3706812c75..54c83a036e 100644 --- a/packages/graphics/mesa/package.mk +++ b/packages/graphics/mesa/package.mk @@ -3,8 +3,8 @@ # Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv) PKG_NAME="mesa" -PKG_VERSION="22.0.0" -PKG_SHA256="e6c41928b5b9917485bd67cec22d15e62cad7a358bf4c711a647979987601250" +PKG_VERSION="22.0.1" +PKG_SHA256="c05f9682c54560b36e0afa70896233fc73f1ed715e10d1a028b0eb84fd04426f" PKG_LICENSE="OSS" PKG_SITE="http://www.mesa3d.org/" PKG_URL="https://mesa.freedesktop.org/archive/mesa-${PKG_VERSION}.tar.xz" From 75f61bc4c15e5671633cccfc1504a71248439fef Mon Sep 17 00:00:00 2001 From: SupervisedThinking Date: Sun, 13 Mar 2022 14:40:57 +0100 Subject: [PATCH 2/2] mesa: panfrost: Process scissor state earlier https://gitlab.freedesktop.org/mesa/mesa/-/issues/6136 https://gitlab.freedesktop.org/mesa/mesa/-/commit/61ba8df3e8c8bab8c03280d3f6a8f249ed22ceab Already upstreamed to & merged in 22.1-dev - not yet backported to 22.0.1 --- ...nfrost-process-scissor-state-earlier.patch | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 packages/graphics/mesa/patches/mesa-999.01-panfrost-process-scissor-state-earlier.patch diff --git a/packages/graphics/mesa/patches/mesa-999.01-panfrost-process-scissor-state-earlier.patch b/packages/graphics/mesa/patches/mesa-999.01-panfrost-process-scissor-state-earlier.patch new file mode 100644 index 0000000000..fbc0533955 --- /dev/null +++ b/packages/graphics/mesa/patches/mesa-999.01-panfrost-process-scissor-state-earlier.patch @@ -0,0 +1,86 @@ +From d2fb6879a2934de03323b9c72b2f4987b2bc38d9 Mon Sep 17 00:00:00 2001 +From: Alyssa Rosenzweig +Date: Sat, 15 Jan 2022 10:29:11 -0500 +Subject: [PATCH] panfrost: Process scissor state earlier + +Otherwise, if batch->scissor_culls_everything is set for a single draw, +every draw after it in the batch will be skipped because the new +scissor/viewport state will never be processed. Process scissor state +early in draw_vbo to fix this interaction. + +We do need to be careful: setting something on the batch can only happen when +we've decided on a batch. If we have to select a fresh batch due to too many +draws, that must happen first. This is pretty clear in the code but worth noting +for the diff. + +Signed-off-by: Alyssa Rosenzweig +Reported-by: Icecream95 +Reviewed-by: Icecream95 +Fixes: 79356b2e ("panfrost: Skip rasterizer discard draws without side effects") +Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5839 +Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6136 +Part-of: +--- + src/gallium/drivers/panfrost/pan_cmdstream.c | 22 ++++++++++++-------- + src/panfrost/ci/panfrost-g52-fails.txt | 1 - + 2 files changed, 13 insertions(+), 10 deletions(-) + +diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c +index 8af81f4b9f5..0f23da2b12e 100644 +--- a/src/gallium/drivers/panfrost/pan_cmdstream.c ++++ b/src/gallium/drivers/panfrost/pan_cmdstream.c +@@ -2642,9 +2642,6 @@ panfrost_update_state_3d(struct panfrost_batch *batch) + { + unsigned dirty = batch->ctx->dirty; + +- if (dirty & (PAN_DIRTY_VIEWPORT | PAN_DIRTY_SCISSOR)) +- batch->viewport = panfrost_emit_viewport(batch); +- + if (dirty & PAN_DIRTY_TLS_SIZE) + panfrost_batch_adjust_stack_size(batch); + } +@@ -3144,6 +3141,19 @@ panfrost_draw_vbo(struct pipe_context *pipe, + /* Do some common setup */ + struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx); + ++ /* Don't add too many jobs to a single batch. Hardware has a hard limit ++ * of 65536 jobs, but we choose a smaller soft limit (arbitrary) to ++ * avoid the risk of timeouts. This might not be a good idea. */ ++ if (unlikely(batch->scoreboard.job_index > 10000)) ++ batch = panfrost_get_fresh_batch_for_fbo(ctx, "Too many draws"); ++ ++ /* panfrost_batch_skip_rasterization reads ++ * batch->scissor_culls_everything, which is set by ++ * panfrost_emit_viewport, so call that first. ++ */ ++ if (ctx->dirty & (PAN_DIRTY_VIEWPORT | PAN_DIRTY_SCISSOR)) ++ batch->viewport = panfrost_emit_viewport(batch); ++ + /* If rasterization discard is enabled but the vertex shader does not + * have side effects (including transform feedback), skip the draw + * altogether. This is always an optimization. Additionally, this is +@@ -3160,12 +3170,6 @@ panfrost_draw_vbo(struct pipe_context *pipe, + return; + } + +- /* Don't add too many jobs to a single batch. Hardware has a hard limit +- * of 65536 jobs, but we choose a smaller soft limit (arbitrary) to +- * avoid the risk of timeouts. This might not be a good idea. */ +- if (unlikely(batch->scoreboard.job_index > 10000)) +- batch = panfrost_get_fresh_batch_for_fbo(ctx, "Too many draws"); +- + unsigned zs_draws = ctx->depth_stencil->draws; + batch->draws |= zs_draws; + batch->resolve |= zs_draws; +diff --git a/src/panfrost/ci/panfrost-g52-fails.txt b/src/panfrost/ci/panfrost-g52-fails.txt +index 07be170f72e..68a2d677df8 100644 +--- a/src/panfrost/ci/panfrost-g52-fails.txt ++++ b/src/panfrost/ci/panfrost-g52-fails.txt +@@ -583,7 +583,6 @@ spec@!opengl 2.1@pbo@test_polygon_stip,Fail + spec@!opengl 2.1@polygon-stipple-fs,Fail + spec@!opengl 3.0@gl-3.0-vertexattribipointer,Fail + spec@!opengl 3.0@required-texture-attachment-formats,Fail +-spec@!opengl 3.0@viewport-clamp,Crash + spec@!opengl 3.1@primitive-restart-xfb flush,Fail + spec@!opengl 3.1@primitive-restart-xfb generated,Fail + spec@!opengl 3.1@primitive-restart-xfb written,Fail