From 256d48eb8cd57e9405b010982a48cf2378d299cc Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 19 Oct 2021 05:20:00 -0700 Subject: [PATCH] iris: Set MOCS on NULL stream output buffers We'd like to add safeguards against accidental use of MOCS 0 (uncached), which can have large performance implications. One case where we use MOCS of 0 is disabled stream output targets, MOCS shouldn't matter, as there's no actual buffer to be cached. That said, it should be harmless to set MOCS for these null stream output buffers; we can just assume a MOCS for generic internal buffers. Reviewed-by: Jason Ekstrand Part-of: --- src/gallium/drivers/iris/iris_state.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 1c5a9ba8189..581580682ad 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -3758,6 +3758,7 @@ iris_set_stream_output_targets(struct pipe_context *ctx, sob._3DCommandOpcode = 0; sob._3DCommandSubOpcode = SO_BUFFER_INDEX_0_CMD + i; #endif + sob.MOCS = iris_mocs(NULL, &screen->isl_dev, 0); } continue; }