[PATCH 11/19] etnaviv: GC7000: Update context reset for ..HALTI5

Christian Gmeiner christian.gmeiner at gmail.com
Sun Nov 5 15:13:40 UTC 2017


2017-10-30 17:16 GMT+01:00 Wladimir J. van der Laan <laanwj at gmail.com>:
> Update context reset for HALTI3..HALTI5, sorting states for the HALTI
> version that has them.
>
> Signed-off-by: Wladimir J. van der Laan <laanwj at gmail.com>

Reviewed-by: Christian Gmeiner <christian.gmeiner at gmail.com>

> ---
>  src/gallium/drivers/etnaviv/etnaviv_context.c | 37 +++++++++++++++++++++++----
>  1 file changed, 32 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c
> index 56ab395..7d54192 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));
> --
> 2.7.4
>



-- 
greets
--
Christian Gmeiner, MSc

https://christian-gmeiner.info


More information about the etnaviv mailing list