panfrost: Implement opportunistic AFBC

Graphics / Mesa 3D Graphics Library / Mesa - Alyssa Rosenzweig [collabora.com] - 16 July 2019 14:21 EDT

Rather than hardcoding a BO layout at creation-time, we implement the ability to hint layouts at various points in a BO's lifetime, potentially reallocating and switching layouts if it's heuristically deemed useful to do so.

In this patch, we add a simple hinting implementation, opportunistically compressing FBOs.

Support is hidden behind PAN_MESA_DEBUG=afbc as the implementation is incomplete (software access to AFBC is unimplemented at the moment) and therefore would regress significantly.

5ad00fb3ed9 panfrost: Implement opportunistic AFBC
src/gallium/drivers/panfrost/pan_context.c | 31 +++++++++++++++
src/gallium/drivers/panfrost/pan_resource.c | 60 +++++++++++++++++++++++++++++
src/gallium/drivers/panfrost/pan_resource.h | 7 ++++
src/gallium/drivers/panfrost/pan_screen.c | 2 +-
src/gallium/drivers/panfrost/pan_util.h | 1 +
5 files changed, 100 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share