Module: Mesa
Branch: main
Commit: 50d68f74b503d3a65a89f10c32c199cdb4431054
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=50d68f74b503d3a65a89f10c32c199cdb4431054

Author: Iván Briano <[email protected]>
Date:   Wed Jul  5 15:40:52 2023 -0700

iris: ensure mesh is disabled on context init

It turns out the hardware doesn't save the whole state on a context
switch, as the kernel expects when it creates the golden context.
For some HW units, only the state that was explicitly programmed will be
part of it, so we need to make sure mesh shading is disabled on context
creation, or we risk being context switched with an application that
uses mesh, and when ours gets to run again, the mesh state won't be
reset, and submitting a legacy 3D pipeline while the HW thinks mesh is
enabled causes us to hang.

Cc: 23.2 <mesa-stable>

Reviewed-by: Marcin Ślusarz <[email protected]>
Reviewed-by: José Roberto de Souza <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24150>

---

 src/gallium/drivers/iris/iris_state.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/gallium/drivers/iris/iris_state.c 
b/src/gallium/drivers/iris/iris_state.c
index ef08abbe10c..2445df96d1b 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -1339,6 +1339,11 @@ iris_init_render_context(struct iris_batch *batch)
    /* TODO: may need to set an offset for origin-UL framebuffers */
    iris_emit_cmd(batch, GENX(3DSTATE_POLY_STIPPLE_OFFSET), foo);
 
+#if GFX_VERx10 >= 125
+   iris_emit_cmd(batch, GENX(3DSTATE_MESH_CONTROL), foo);
+   iris_emit_cmd(batch, GENX(3DSTATE_TASK_CONTROL), foo);
+#endif
+
    iris_alloc_push_constants(batch);
 
 

Reply via email to