[PATCH] etnaviv: Set up GC3000 states, fix point sprite rendering

Lucas Stach l.stach at pengutronix.de
Sun Oct 1 11:38:16 UTC 2017


Am Sonntag, den 01.10.2017, 12:46 +0200 schrieb Christian Gmeiner:
> 2017-09-26 12:29 GMT+02:00 Wladimir J. van der Laan <laanwj at gmail.com>:
> > Set up new states that the blob started setting for GC3000 consistently.
> > 
> > This makes sure that when another test or driver leaves the GPU in
> > unpredictable state, these states are set up correctly for our
> > rendering.
> > 
> 
> I am not sure if this counts as valid argument to set some of the unknown states
> back to 0. I can not image that a normal user will run in this kind of
> situation at all.
> Just my opinion. If you insist in having a hand full unknown states
> set back to 0
> I can life with it and will push the patch in its current form.

I think it's actually a good idea to reset the GPU to the expected
state in the context reset. No process should depend on any particular
GPU state between submits, as any other process might leave the GPU
totally screwed.

It's a good idea to initialize the state that we don't normally
overwrite during state emission.

> > 
> > Also, setting PA_VIEWPORT_UNK00A84 to fui(8192.0) is necessary
> > to make point sprite rendering on GC3000 work.
> 
> I would prefer a patch that only sets PA_VIEWPORT_UNK00A84 to fix point
> sprite rendering on GC3000.

Yeah, splitting up this patch into 2 would be good style.

Regards,
Lucas

> > 
> > Signed-off-by: Wladimir J. van der Laan <laanwj at gmail.com>
> > ---
> >  src/gallium/drivers/etnaviv/etnaviv_context.c | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> > 
> > diff --git a/src/gallium/drivers/etnaviv/etnaviv_context.c b/src/gallium/drivers/etnaviv/etnaviv_context.c
> > index 2ca09ce..67aab6a 100644
> > --- a/src/gallium/drivers/etnaviv/etnaviv_context.c
> > +++ b/src/gallium/drivers/etnaviv/etnaviv_context.c
> > @@ -317,6 +317,19 @@ etna_cmd_stream_reset_notify(struct etna_cmd_stream *stream, void *priv)
> >     etna_set_state(stream, VIVS_GL_VERTEX_ELEMENT_CONFIG, 0x00000001);
> >     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_VIEWPORT_UNK00A80, 0x38a01404);
> > +   etna_set_state(stream, VIVS_PA_VIEWPORT_UNK00A84, fui(8192.0));
> > +   etna_set_state(stream, VIVS_PA_ZFARCLIPPING, 0x00000000);
> > +   etna_set_state(stream, VIVS_PE_ALPHA_COLOR_EXT0, 0x00000000);
> > +   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);
> > 
> >     /* 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
> _______________________________________________
> etnaviv mailing list
> etnaviv at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/etnaviv


More information about the etnaviv mailing list