drm/vc4: Add T-format scanout support.
authorEric Anholt <eric@anholt.net>
Mon, 5 Jun 2017 19:16:10 +0000 (12:16 -0700)
committerRaspbian kernel package updater <root@raspbian.org>
Sat, 31 Mar 2018 14:54:20 +0000 (15:54 +0100)
commit13683efdc2ce9e7199be4732419f24b6f9a37f3a
treec2bfba141488621a6677a9a1b9573dfb84b43ef6
parente173e97b5432027d9c13a0fc6448a5145ca2fe60
drm/vc4: Add T-format scanout support.

The T tiling format is what V3D uses for textures, with no raster
support at all until later revisions of the hardware (and always at a
large 3D performance penalty).  If we can't scan out V3D's format,
then we often need to do a relayout at some stage of the pipeline,
either right before texturing from the scanout buffer (common in X11
without a compositor) or between a tiled screen buffer right before
scanout (an option I've considered in trying to resolve this
inconsistency, but which means needing to use the dirty fb ioctl and
having some update policy).

T-format scanout lets us avoid either of those shadow copies, for a
massive, obvious performance improvement to X11 window dragging
without a compositor.  Unfortunately, enabling a compositor to work
around the discrepancy has turned out to be too costly in memory
consumption for the Raspbian distribution.

Because the HVS operates a scanline at a time, compositing from T does
increase the memory bandwidth cost of scanout.  On my 1920x1080@32bpp
display on a RPi3, we go from about 15% of system memory bandwidth
with linear to about 20% with tiled.  However, for X11 this still ends
up being a huge performance win in active usage.

This patch doesn't yet handle src_x/src_y offsetting within the tiled
buffer.  However, we fail to do so for untiled buffers already.

Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/vc4/vc4_plane.c
drivers/gpu/drm/vc4/vc4_regs.h
include/uapi/drm/drm_fourcc.h