[Mesa-dev] [PATCH 0/8] Add DCC support.

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Fri Sep 4 14:49:05 PDT 2015


On Friday, September 04, 2015 05:00:47 PM Alex Deucher wrote:
> On Fri, Sep 4, 2015 at 3:47 PM, Bas Nieuwenhuizen
> 
> <bas at basnieuwenhuizen.nl> wrote:
> > This patch series enables delta color compression (DCC) for Vulcanic
> > Islands GPU's. This should reduce memory bandwidth to increase
> > performance.
> > 
> > I have found no documentation on this feature, so most of the work is
> > based on guesswork, register names and Catalyst traces.
> 
> FWIW, all of the register information is available in mesa and in the
> kernel:
> http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers
> /gpu/drm/amd/include/asic_reg/gca

Right and those have been very helpful (note that the kernel driver is much 
more complete than the mesa headers for VI).

But it does not always help much with what the flags do and for example the 
buffer format is (as far as I could see) not documented.

> > Some benchmarks I've ran:
> > 
> > nexuiz    68.83 -> 81.62
> > openarena 50.90 -> 50.80
> > heaven     5.47 ->  6.26
> > valley     9.58 -> 10.40
> > xonotic   60.32 -> 60.27
> > 
> > Note that DCC for SCANOUT surfaces is still disabled, as the X server
> > can be rendering to it as front buffer, which has no resource flush.
> 
> The display hardware does not support DCC.

It is just that with double-buffering one could still decompress before 
display, but that is out of the question when using single-buffered rendering.

> > As a side effect, the main framebuffers of clients (at least on DRI2)
> > are also not DCC enabled. As passing a surface to the X server and
> > display are the most common reasons for decompressing, games should not
> > pretty much never trigger the DCC decompression path. We therefore
> > should have only very minor performance regressions. If I enable DCC
> > for SCANOUT buffers in applications I get
> > 
> > nexuiz    68.83 -> 78.81
> > openarena 50.90 -> 56.10
> > heaven     5.47 ->  6.28
> > valley     9.58 -> 10.54
> > xonotic   60.32 -> 56.26
> > 
> > This change would have somewhat mixed results, with a regression for
> > xonotic.
> 
> DCC is not always a win so there probably needs to be heuristics as to
> when to enable it.

(Note the second set of numbers is for a change which is not done by this 
series and I am not planning to).

Most of the significant performance regressions seem to be caused by a 
decompress taking more time than a fastclear elimination( or nothing at all if 
the buffer is not cleared). This is only triggered on flush_resource(), which as 
far as I can see only happens when sharing the texture.

With DRI2, my system always gives me SCANOUT framebuffers, even when the 
application is not running fullescreen, which means that decompression will 
not happen in this common case. Although I realize now that I am not sure that 
flag is always set when a compositor is used, as I am not too familiar with 
that area.

- Bas

> Alex
> 
> > As for testing, I run this systemwide for a few days now and a piglit
> > test minus a few tests that locked up on the baseline or
> > seemingly gave random results, did not result in regressions.
> > 
> > Bas Nieuwenhuizen (8):
> >   radeonsi: Allocate buffers for DCC.
> >   radeonsi: Add DCC compression tracking machinery.
> >   radeonsi: Enable DCC.
> >   radeonsi: Add DCC fast clear.
> >   radeonsi: Invalidate the L2 cache on framebuffer change.
> >   radeonsi: Add sampling of DCC compressed textures.
> >   radeonsi: Do not decompress DCC textures for sampling.
> >   radeonsi: Add DCC for multisampled textures.
> >  
> >  src/gallium/drivers/radeon/r600_buffer_common.c | 20 +++++++
> >  src/gallium/drivers/radeon/r600_pipe_common.h   |  9 ++++
> >  src/gallium/drivers/radeon/r600_texture.c       | 69
> >  +++++++++++++++++++++---- src/gallium/drivers/radeon/r600d_common.h     
> >   |  1 +
> >  src/gallium/drivers/radeon/radeon_winsys.h      |  5 ++
> >  src/gallium/drivers/radeonsi/cik_sdma.c         |  6 ++-
> >  src/gallium/drivers/radeonsi/si_blit.c          | 39 +++++++++-----
> >  src/gallium/drivers/radeonsi/si_descriptors.c   |  5 ++
> >  src/gallium/drivers/radeonsi/si_dma.c           |  6 ++-
> >  src/gallium/drivers/radeonsi/si_pipe.c          |  2 +
> >  src/gallium/drivers/radeonsi/si_pipe.h          |  3 ++
> >  src/gallium/drivers/radeonsi/si_state.c         | 47 ++++++++++++++---
> >  src/gallium/drivers/radeonsi/si_state_draw.c    | 14 +++++
> >  src/gallium/drivers/radeonsi/sid.h              |  1 +
> >  src/gallium/winsys/amdgpu/drm/amdgpu_surface.c  | 47 +++++++++++++++--
> >  15 files changed, 237 insertions(+), 37 deletions(-)
> > 
> > --
> > 2.5.1
> > 
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list