[Mesa-dev] [PATCH 3/3] etnaviv: Add sampler TS support

Wladimir J. van der Laan laanwj at gmail.com
Fri Nov 10 10:00:09 UTC 2017


On Fri, Nov 10, 2017 at 07:42:12AM +0100, Wladimir J. van der Laan wrote:
> Hello Lucas,
> 
> On Thu, Nov 09, 2017 at 06:15:51PM +0100, Lucas Stach wrote:
> > Hi Wladimir!
> 
> > > etna_resource_needs_flush is only called from two places - here, and
> > > in resource_flush, where it also determines whether to do a
> > > resolve-to-self, but before presenting the image. There it also only
> > > makes sense to do if the resource has at least a valid TS.
> > 
> > Yes, this makes sense.
> > 
> > Also I've just tested this and I've seen some intermittent missing
> > shadow tiles in the glmark2 shadow demo. Probably you are now missing
> > the TS cache flush we would normally do before blitting the shadow
> > image with the RS.
> 
> Thanks for testing!
> 
> I'll see if I can reproduce it. 

I was unable to reproduce it locally.

Can you please test if the below patch solves it?

Regards,
Wladimir

commit c26944fc3441e2516d4e4d17540b0f504cdcaf97
Author: Wladimir J. van der Laan <laanwj at gmail.com>
Date:   Fri Nov 10 09:48:19 2017 +0000

    etnaviv: Flush TS cache before changing TS configuration
    
    This is to make sure that the TS is properly flushed to memory before
    rendering to a new surface starts.
    
    Signed-off-by: Wladimir J. van der Laan <laanwj at gmail.com>

diff --git a/src/gallium/drivers/etnaviv/etnaviv_emit.c b/src/gallium/drivers/etnaviv/etnaviv_emit.c
index d313af6..b6b06e3 100644
--- a/src/gallium/drivers/etnaviv/etnaviv_emit.c
+++ b/src/gallium/drivers/etnaviv/etnaviv_emit.c
@@ -322,6 +322,11 @@ etna_emit_state(struct etna_context *ctx)
       etna_stall(stream, SYNC_RECIPIENT_RA, SYNC_RECIPIENT_PE);
    }
 
+   /* Flush TS cache before changing TS configuration. */
+   if (unlikely(dirty & ETNA_DIRTY_TS)) {
+      etna_set_state(stream, VIVS_TS_FLUSH_CACHE, VIVS_TS_FLUSH_CACHE_FLUSH);
+   }
+
    /* If MULTI_SAMPLE_CONFIG.MSAA_SAMPLES changed, clobber affected shader
     * state to make sure it is always rewritten. */
    if (unlikely(dirty & (ETNA_DIRTY_FRAMEBUFFER))) {


More information about the mesa-dev mailing list