[Mesa-dev] [PATCH 0/9] RadeonSI cache flush optimizations

Marek Olšák maraeo at gmail.com
Fri Jun 16 12:57:56 UTC 2017


Hi,

This series:
- reworks CB (MSAA-only) and DB flushes
- removes L2 flushes for CP packets and indirect buffers for GFX9
- enables the constant engine for GFX9 (yay!)
- removes all flushes and waits from the end of IBs (relying on
  the kernel fence to do that)

The rework of CB and DB flushes is the most interesting piece. It
takes advantage of the fact and DB and CB MSAA rendering is always
followed by a decompression pass before shader reads except when HTILE
is TC-compatible, but the infrastructure is there.

We can use the color/depth_needs_decompression tracking to determine
exactly when a surface is transitioned from CB/DB writes to shader
reads and do the cache flush in the decompress function. This has
the advantage that we don't have to flush DB and CB-MSAA in set_frame-
buffer_state and memory_barrier.

For TC-compatible HTILE, the code still marks depth textures as
needing decompression, but the decompress function will not do any
decompression, it will only do the cache flush.

It significantly reduces the number of DB flushes. If an app doesn't
use depth texturing, the driver never flushes DB. Apps overusing
memory_barrier(FRAMEBUFFER) will also see a lot fewer DB flushes.
For example, DeusEx:MD has 10x fewer DB flushes per frame now.
Not that it helps performance there, but it's good to have it.

Same for CB MSAA. If the current framebuffer is MSAA, set_framebuffer-
_state, memory_barrier, and texture_barrier don't flush CB. The CB
flush is only done after the decompression pass where we are 100% sure
that TC reads will follow.

Please review.

Marek


More information about the mesa-dev mailing list