summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2019-10-05 15:02:28 -0400
committerKenneth Graunke <[email protected]>2019-10-05 17:18:45 -0400
commit4f857423b3c095516e553b976b41969c2b9721fa (patch)
tree08fb031edd8d6765bf8f375c214ed261b33f4290 /src
parentf1bba22f69323eb4b7fc11abab3d14ecacafa5b4 (diff)
iris: Hack up a SKL/Gen9LP PS push constant fifo depth workaround
This is a port of Nanley's 904c2a617d86944fbdc2c955f327aacd0b3df318 from i965 to iris. One concern is that iris uses larger batches, and also emits far fewer commands, so we may come closer to the 500 limit within a batch, and could need to supplement this with actual counting. Manhattan 3.0 had 239 3DSTATE_CONSTANT_PS packets in a batch, Unigine Valley had 155. So it seems like we're still in the realm of safety.
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_state.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c
index b66eee791d1..9db8263920b 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -5539,6 +5539,29 @@ iris_upload_render_state(struct iris_context *ice,
{
bool use_predicate = ice->state.predicate == IRIS_PREDICATE_STATE_USE_BIT;
+ UNUSED const struct gen_device_info *devinfo = &batch->screen->devinfo;
+
+ /* The Skylake PRM's Workarounds section (#878) says:
+ *
+ * "Push constant buffer corruption possible. WA: Insert 2 zero-length
+ * PushConst_PS before every intended PushConst_PS update, issue a
+ * NULLPRIM after each of the zero len PC update to make sure CS commits
+ * them."
+ *
+ * This workaround is attempting to solve a pixel shader push constant
+ * synchronization issue.
+ *
+ * An unpublished WA suggests re-emitting 3DSTATE_PUSH_CONSTANT_ALLOC_PS
+ * for every 500 or so 3DSTATE_CONSTANT_PS packets. Since our counting
+ * methods may not be reliable due to context-switching and pre-emption,
+ * we instead choose to approximate this behavior by re-emitting the
+ * packet on the first regular draw of the batch.
+ */
+ if (GEN_GEN == 9 && !batch->contains_draw &&
+ (devinfo->is_skylake || gen_device_info_is_9lp(devinfo))) {
+ iris_alloc_push_constants(batch);
+ }
+
/* Always pin the binder. If we're emitting new binding table pointers,
* we need it. If not, we're probably inheriting old tables via the
* context, and need it anyway. Since true zero-bindings cases are