summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2017-11-18 10:44:33 +0100
committerChristian Gmeiner <[email protected]>2017-11-30 07:28:09 +0100
commitc6033e84bbdf0e437933eb35a729a95acf2c9a45 (patch)
treed0d2f35fe429adef04dbe9bae08ad80a6dcad780
parentbaff59ebf07a114f95ad66d1f54e4b1f409eebee (diff)
etnaviv: GC7000: Update context reset for ..HALTI5
Update context reset for HALTI3..HALTI5, sorting states for the HALTI version that has them. Signed-off-by: Wladimir J. van der Laan <[email protected]> Reviewed-by: Christian Gmeiner <[email protected]>
-rw-r--r--src/gallium/drivers/etnaviv/etnaviv_context.c37
1 files changed, 32 insertions, 5 deletions
diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c
index 56ab3958a71..7d54192dfcb 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_context.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_context.c
@@ -333,10 +333,11 @@ etna_cmd_stream_reset_notify(struct etna_cmd_stream *stream, void *priv)
etna_set_state(stream, VIVS_GL_API_MODE, VIVS_GL_API_MODE_OPENGL);
etna_set_state(stream, VIVS_GL_VERTEX_ELEMENT_CONFIG, 0x00000001);
+ /* blob sets this to 0x40000031 on GC7000, seems to make no difference,
+ * but keep it in mind if depth behaves strangely. */
etna_set_state(stream, VIVS_RA_EARLY_DEPTH, 0x00000031);
etna_set_state(stream, VIVS_PA_W_CLIP_LIMIT, 0x34000001);
- etna_set_state(stream, VIVS_PA_FLAGS, 0x00000000); /* blob sets ZCONVERT_BYPASS on GC3000, this messes up z for us */
- etna_set_state(stream, VIVS_RA_UNK00E0C, 0x00000000);
+ etna_set_state(stream, VIVS_PA_FLAGS, 0x00000000); /* blob sets ZCONVERT_BYPASS on GC3000+, this messes up z for us */
etna_set_state(stream, VIVS_PA_VIEWPORT_UNK00A80, 0x38a01404);
etna_set_state(stream, VIVS_PA_VIEWPORT_UNK00A84, fui(8192.0));
etna_set_state(stream, VIVS_PA_ZFARCLIPPING, 0x00000000);
@@ -344,11 +345,37 @@ etna_cmd_stream_reset_notify(struct etna_cmd_stream *stream, void *priv)
etna_set_state(stream, VIVS_PE_ALPHA_COLOR_EXT1, 0x00000000);
etna_set_state(stream, VIVS_RA_HDEPTH_CONTROL, 0x00007000);
etna_set_state(stream, VIVS_PE_STENCIL_CONFIG_EXT2, 0x00000000);
- etna_set_state(stream, VIVS_GL_UNK03834, 0x00000000);
- etna_set_state(stream, VIVS_GL_UNK03838, 0x00000000);
- etna_set_state(stream, VIVS_GL_UNK03854, 0x00000000);
etna_set_state(stream, VIVS_PS_CONTROL_EXT, 0x00000000);
+ /* There is no HALTI0 specific state */
+ if (ctx->specs.halti >= 1) { /* Only on HALTI1+ */
+ etna_set_state(stream, VIVS_VS_HALTI1_UNK00884, 0x00000808);
+ }
+ if (ctx->specs.halti >= 2) { /* Only on HALTI2+ */
+ etna_set_state(stream, VIVS_RA_UNK00E0C, 0x00000000);
+ }
+ if (ctx->specs.halti >= 3) { /* Only on HALTI3+ */
+ etna_set_state(stream, VIVS_PE_MEM_CONFIG, 0x00000000); /* TODO: cache modes */
+ etna_set_state(stream, VIVS_PS_HALTI3_UNK0103C, 0x76543210);
+ }
+ if (ctx->specs.halti >= 4) { /* Only on HALTI4+ */
+ etna_set_state(stream, VIVS_PS_MSAA_CONFIG, 0x6fffffff & 0xf70fffff & 0xfff6ffff &
+ 0xffff6fff & 0xfffff6ff & 0xffffff7f);
+ etna_set_state(stream, VIVS_PE_HALTI4_UNK014C0, 0x00000000);
+ }
+ if (ctx->specs.halti >= 5) { /* Only on HALTI5+ */
+ etna_set_state(stream, VIVS_NTE_DESCRIPTOR_UNK14C40, 0x00000001);
+ etna_set_state(stream, VIVS_FE_HALTI5_UNK007D8, 0x00000002);
+ etna_set_state(stream, VIVS_FE_HALTI5_UNK007C4, 0x00000000);
+ etna_set_state(stream, VIVS_PS_SAMPLER_BASE, 0x00000000);
+ etna_set_state(stream, VIVS_VS_SAMPLER_BASE, 0x00000020);
+ etna_set_state(stream, VIVS_SH_CONFIG, VIVS_SH_CONFIG_RTNE_ROUNDING);
+ } else { /* Only on pre-HALTI5 */
+ etna_set_state(stream, VIVS_GL_UNK03834, 0x00000000);
+ etna_set_state(stream, VIVS_GL_UNK03838, 0x00000000);
+ etna_set_state(stream, VIVS_GL_UNK03854, 0x00000000);
+ }
+
if (!ctx->specs.use_blt) {
/* Enable SINGLE_BUFFER for resolve, if supported */
etna_set_state(stream, VIVS_RS_SINGLE_BUFFER, COND(ctx->specs.single_buffer, VIVS_RS_SINGLE_BUFFER_ENABLE));