[Mesa-dev] [PATCH v2 3/7] radeonsi: Add a CACHE_FLUSH event

Marek Olšák maraeo at gmail.com
Sun Oct 11 17:26:34 PDT 2015


On Sun, Oct 11, 2015 at 5:38 PM, Bas Nieuwenhuizen
<bas at basnieuwenhuizen.nl> wrote:
> Needed for various DCC related operations. As invalidating the L2
> cache seems unnecesary, this introduces a new flag to flush the cache
> without invalidating the L2 cache.
>
> Signed-off-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
> ---
>  src/gallium/drivers/radeonsi/si_pipe.h       | 1 +
>  src/gallium/drivers/radeonsi/si_state_draw.c | 3 +++
>  2 files changed, 4 insertions(+)
>
> diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h
> index 2abd5b5..b43c027 100644
> --- a/src/gallium/drivers/radeonsi/si_pipe.h
> +++ b/src/gallium/drivers/radeonsi/si_pipe.h
> @@ -68,6 +68,7 @@
>  /* Compute only. */
>  #define SI_CONTEXT_FLUSH_WITH_INV_L2   (R600_CONTEXT_PRIVATE_FLAG << 13) /* TODO: merge with TC? */
>  #define SI_CONTEXT_FLAG_COMPUTE                (R600_CONTEXT_PRIVATE_FLAG << 14)
> +#define SI_CONTEXT_FLUSH               (R600_CONTEXT_PRIVATE_FLAG << 15)

This looks too heavy. These 2 events are enough to flush DCC before
using it for texturing:
- FLUSH_AND_INV_CB_META
- FLUSH_AND_INV_CB_DATA_TS

The former is always emitted, so you just need to add the latter. I
think you can just extend the meaning of SI_CONTEXT_FLUSH_AND_INV_CB
and make it emit FLUSH_AND_INV_CB_DATA_TS in addition to surface_sync.

As a result, you won't need to update set_framebuffer_state and CP DMA
functions later.

Marek


More information about the mesa-dev mailing list