OSDN Git Service

vc4: Set shareable BOs as T tiled if possible
authorEric Anholt <eric@anholt.net>
Mon, 5 Jun 2017 21:50:26 +0000 (14:50 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 12 Jul 2017 17:58:33 +0000 (10:58 -0700)
commit84ed8b67c56b323cd834d463151e1a3c0430c53e
tree5b59af4b319a15d2617ae598fb90fcdce952d53f
parentbb466a996ffcd328d7f4b543a202291913800979
vc4: Set shareable BOs as T tiled if possible

X11 and GL compositor performance on VC4 has been terrible because of our
SHARED-usage buffers all being forced to linear.  This swaps SHARED &&
!LINEAR buffers over to being tiled.

This is an expected win for all GL compositors during rendering (a full
copy of each shared texture per draw call), allows X11 to be used with
decent performance without a GL compositor, and improves X11 windowed
swapbuffers performance as well.  It also halves the memory usage of
shared buffers that get textured from.  The only cost should be idle
systems with a scanout-only buffer that isn't flagged as LINEAR, in which
case the memory bandwidth cost of scanout goes up ~25%.

This implements the EGL_EXT_image_dma_buf_import_modifiers extension,
supporting the VC4 T_TILED modifier.

v2: Added modifier support to resource creation/import, and
    advertisement (by daniels).
v3: Fix old-kernel fallback path, fix compiler error and warnings, and
    comment touchups (by anholt).

Reviewed-by: Daniel Stone <daniels@collabora.com>
src/gallium/drivers/vc4/vc4_resource.c
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/vc4/vc4_screen.h
src/gallium/drivers/vc4/vc4_simulator.c